rsync files with mtime

Matt McCutchen hashproduct+rsync at gmail.com
Fri Feb 2 03:14:56 GMT 2007


On 1/30/07, Richard Z <rzheng at gmail.com> wrote:
> I try to rsync files only X days old.
>
> This is my setup. The backup server needs to store all servers' backup
> and only has space for 7 days backup. But each individual server has
> backup for 21 days. On the backup server, i remove files older than 7
> days. When backup server pulls files, I want rsync only pull files
> with mtime last 7 days.

I'm not clear on exactly why you would want to pull these files, but
I'll show you how...

> (cd src && find . -atime +6 -print) | rsync --files-from=- src/ dest/
>
> This works on the source server, but not on the dest server.
>
> Anyone knows how to get the job done on the backup server?

Try this:

rsync --rsync-path='rsync --files-from=<(cd src && find . -atime +6 -print)' \
        remote:src/ dest/

(Do you want -mtime, perhaps, instead of -atime?)

Matt


More information about the rsync mailing list