Hello List, 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. Thanks, Mario
On Fri 17 Feb 2006, 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.The purpose of rsync is to synchronize two directories, irrespective of what timestamps the files on the source side may have. If you move a file with a very old mtime into the source directory, that file will be copied to the other side. Same goes if the file is very new. Note that for backups it's common to search for files *younger* than X days, instead of older :-) Paul Slootman
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@verizon.net http://hashproduct.metaesthetics.net/
On Friday 17 Feb 2006 13:55, Mario Ohnewald wrote:> Hello List, > > 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.This might not be what you are looking for, but I have found it very useful http://rsnapshot.org/ -- ----------------- Bob Hutchinson Midwales dot com -----------------