Knowledgebase

backup script

Posted by bingowings23456, 11-11-2013, 08:41 PM
Hi, Could someone assist me in making a backup script for Linux centos. Tasks: check if folder /home/user/backups exists, if not create check if file log.txt exists, if not create in /home/user/backups delete 8 day old (keep days 1-7) tar files on local server create tar with date in file name to folder /home/user/backups connect to ftp site check if folder /backups exists, if not create delete 8 day (keep days 1-7) old tar files upload new tar close connection write to log file log.txt time complete and the word complete if backup fails, write to log.txt time failed and the words backup failed. Thanks very much

Posted by my247webhosting, 11-12-2013, 02:01 PM
You can easily code in in shell script around 10-12 lines code.

Posted by bingowings23456, 11-12-2013, 03:05 PM
I tried doing this myself but ended up deleting the folder I wanted to backup, somehow Need a professional or someone to do this.

Posted by whmcsguru, 11-12-2013, 03:29 PM
Then you'll want to post in one of these forums.

Posted by whmxtra, 11-13-2013, 12:58 AM
Well if you are running cpanel their new backup system will do all of that for you, just remember when you turn it on to click to select the users to backup as it for some reason doesn't automatically enable it for users.

Posted by bitcoindh, 11-13-2013, 08:50 PM
My example script to make backup files and MySQL database This script no check file exist but you can easily make modification. Example check if file exist



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Short and sweet (Views: 546)


Language:

Client Login

Email

Password

Remember Me

Search