exclude option for rsync

Cameron Simpson cs at zip.com.au
Sun Nov 9 23:54:17 UTC 2008


On 10Nov2008 09:56, L <yuanlux at gmail.com> wrote:
| I use rsync to sync a mirror site. I wnat to exclude files that were created
| more than 10 days ago. I have  a long list of excludes in a file. But I want
| a dynamic option.
| what is the option for this in rsync ?

As far as I'm aware there isn't one. The include/exclude stuff is
entirely pathname based. I have in the past done a recursive _listing_
of a mirror site, chosen files out of that, and constructed an
include/exclude file on that basis. This was automated with a script.

In my case the example was a GNU archive with multiple versions of
packages; I wished only to mirror the "latest" package.

If you can construct (via, perhaps, "rsync -n" and some postprocessing)
a list of the remote files that you want, or do not want, it is a pretty
easy task to convert that into an include/exclude list automatically. Then
you just use that in a wrapper script for calling rsync.

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

MS-DOS: "... an OS originally designed for a microprocessor that modern
kitchen appliances would sneer at...."
        - Dave Trowbridge, _Computer Technology Review_, Aug '90




More information about the fedora-list mailing list