backintime and mysql_dumps backup script

er0sion
Posts: 5
Joined: Sun Jul 10, 2011 8:54 am

backintime and mysql_dumps backup script

Postby er0sion » Tue Nov 29, 2011 9:59 am

Hello,

I have created a solution that works for me to backup files / folders to Dropbox. This solution requires that dropbox for amahi be installed.

My Setup:
Backintime and mysql dumps are performed nightly via crontab to /mnt/hda/Backups/
My Dropbox Sync folder is located in /mnt/hda/Dropbox/

The problem I was facing is that, though, backintime has an expiration setting, I really wanted more control over what I wanted deleted, and I wanted to be able to set this up real quick.

backintime folders must be in the following format: yyyymmdd-hhmmss-xxx
mysql dump must be in the following format: mysql_backup_yyyy-mm-dd

Simply set $dir to your original Backups location, $dst to your Dropbox backups folder. Change $expiration if necessary, run script.
There isnt much error checking and the script does copy the files over everytime the script is performed, so if you modified a backup in dropbox, it will overwrite your changes if you didnt back it up again to $dir

in dropbox_maint.php you can display output or supress it by adding (or removing) 'true':

$dropbox->Clean(true);
$dropbox->BackupToDropbox(true);

The script also has a 'dumb' exemption list, which just checks the file name, and not path. If the file is found in the exemption list, it will not copy it to dropbox.

The attached zip contains a dropbox class that i created in php and the dropbox_maint.php is the script that uses the class.

if you would like more features added to the class, let me know.
Attachments
backups.zip
(2.02 KiB) Downloaded 237 times

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: backintime and mysql_dumps backup script

Postby bigfoot65 » Tue Nov 29, 2011 10:33 am

Great stuff! Would you mind putting this guidance in the wiki? It would be more beneficial to users and easier to find.

http://wiki.amahi.org

We are trying to build a repository of user contributions such as this in the wiki. Makes the HDA better for all.

Thanks again!
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

Who is online

Users browsing this forum: No registered users and 18 guests