1

using rsync to do daily backups of our databases but i don't want to mirror the original every days and just download the files that have changed.

this is nearly there but when there's one match in the directory it copies everything over. Eventually id get it to find files that have been edited in the last day (-mtime -1)

rsync -aP -p -o -g --progress `find /Volumes/MP_JUBBLER/testing/src/ -mmin -4` /Volumes/MP_JUBBLER/testing/backups/current/

thats just a test and normally we login into our remote hosting server so thought this would work but its a similar problem. as soon as there's a match it downloads everything;

rsync -aP -p -o -g --progress -e 'ssh -p 2020' root@111.111.111.111:'`find /var/lib/mysql -mmin -10`' /Volumes/MP_JUBBLER/testing/backups/current/

does anyone know how i can get this done? Any pointers appreciated!

Dan.

1

You need to change your find to look at files.

find /Volumes/MP_JUBBLER/testing/src/ -mmin -4 -type f 
  • thanks topdog - i've tried that but it doesn't copy across new directories? I've also got a problem with spaces in my filenames which the line of code doesn't like. I tried 'command...' but it affects the find function... – v3nt Nov 8 '10 at 16:56
  • using "..." sorted out the spaces in filenames but still not too sure how to solve the directories issue... – v3nt Nov 8 '10 at 17:09
  • you could use two commands, one with -type f to copy from existing directories, and -type d to copy new directories – topdog Nov 8 '10 at 17:12
  • yeh - just tried that but when it copies a directory it also copies the files! How about generating an -include list with find and then just rsyncing those files... not really sure how i'd do that though... – v3nt Nov 8 '10 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.