The goal is to rsync (or using any other tools that give the desired result) only files that are created or modified after a date. It should work with filenames containing spaces (and/or other characters that needs to escaped).
I succeeded using this command on OS X 10.6.5:
find . -newermt "2010-11-23 16:52:50" -type f -exec rsync -vuptn '{}' ../rsync_test/ ';'
I don't think -newermt
is working on ohter OS than OS X though.
The problem with this command is that it runs rsync once per file found and that doesn't seems to be the proper way to do it. I tried to change the last ;
with a +
so it waits for the entire file list, but it brakes (I did try "+"
,\+
and other way to escape).
Background: I am trying to backup my files at a remote location. The files being a lot photos in raw and other format (photographs work. about 30GB per day), rsync'ing though the network would take unusable time due to small upload bandwidth (ADSL sucks). So the idea is to have a lot of disk space at a remote location and transporting new/modified files on a small external hard drive once a week. rsync can then easily be used to add the new/modified files at the remote location. For that I need to sync the new/modified files on an external hard drive during the week so I always have 2 copies of every files either at a remote location for files older than a week or on an external hard drive for new/modified files since the last transport.
I was going to make this command run every 10 minutes (cron) with the date and time from the last time it was run.
Can you fix my command? Or do you have an even better solution?
find
support-newermt
.