Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

You need to change your find to look at files.

find /Volumes/MP_JUBBLER/testing/src/ -mmin -4 -type f 
share|improve this answer
    
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... –  daniel Crabbe Nov 8 '10 at 16:56
    
using "..." sorted out the spaces in filenames but still not too sure how to solve the directories issue... –  daniel Crabbe 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... –  daniel Crabbe Nov 8 '10 at 17:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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