• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Auto Database Backup Script 1.0

Admin

Well-Known Member
Staff member
Administrator
These are 2 scripts I wrote to automate the nightly backup of my databases and upload them to a remote location via FTP.

There is a bash script that you call from cron at a time of your choice. This uses mysqldump to make a copy of your database, compress is using pbzip2 (adjust to bzip2 or gzip if you don't have pbzip2 installed), and then calls the upload.pl script to upload the file via FTP to the remote site (keeping 5 rolling days worth of backups).

For my own use, I backup several databases each night, so the perl script is creating an array of file names, and using a foreach loop. If you only have a single database to back up, you can remove the foreach loop, and set the array to be a single variable.

Feel free to adjust to suite your own needs, and I'll try and provide assistance as and where needed.
tuoitrevnbiz10042013.png

tuoitrevnbiz10042013.png

Download tuoitreit.vn_dbbackup.zip (1.4kb)
 

Facebook Comments

New posts New threads New resources

Back
Top