rsync files with certain mtime

Matt McCutchen hashproduct at verizon.net
Sat Feb 18 00:23:17 GMT 2006


On Fri, 2006-02-17 at 14:55 +0100, Mario Ohnewald wrote:
> How would i rsync all files which are older than X-Days? I am missing
> some kind of -mtime option. Since this is quite common for backups i am
> wondering how you are doing this kind of stuff.

Rsync doesn't have an option to transfer only files with a certain range
of mtimes, and in general I think such fancy file selections should be
made outside of rsync and passed to rsync using --files-from.  Try this
incantation to transfer files at least 7 days old:
	(cd src && find . -atime +6 -print) | rsync --files-from=- src/ dest/

-- 
Matt McCutchen
hashproduct at verizon.net
http://hashproduct.metaesthetics.net/



More information about the rsync mailing list