Continuous Backup of moodle site

Re: Continuous Backup of moodle site

by James Steerpike -
Number of replies: 0
I was surprised by this because  I thought rsync was smarter than that. When I tried it locally, the transferred files had a new date created - so the files were newer on the synced folder and hence "different".

You can add a -u flag to the rsync command which ignores the new timestamp on the destination. if you treat the source as your master, that should work,

rsync -uv  ~/source/*.*  ~/Documents/Synced/
sent 1,394,371,905 bytes  received 1,004 bytes  13,092,703.37 bytes/sec
total size is 1,394,027,448  speedup is 1.00

And the second time:
sent 2,089 bytes  received 12 bytes  4,202.00 bytes/sec
total size is 1,394,027,448  speedup is 663,506.64

You can also skip some of the Moodledata folders - there is a current discussion on backup here.

Of course you must still back up and restore your database to the new server - rsync could handle that too. Might be quicker that a restore  if you use batch files and cron.

{Edit} From the man page -t preserves timestamps for smarter copying.
 rsync -tv  ~/source/*.*  ~/Documents/Synced/
Much better!





Average of ratings: Useful (1)