rsync help needed

Daniel Maher dma+rsynclist at
Wed Feb 13 16:00:37 GMT 2008

> > Perhaps i've misunderstood what you're attempting to do; however, if
> > you simply want to exclude some files (not delete them), then you
> > should be using --exclude instead.
> >
> > As far as the time requirement is concerned, you may wish to
> > consider generating the file listing ahead of time (using "find",
> > for example), outputting that list to a text file, then feeding the
> > list to rsync via --exclude-from=FILENAME .
> >
> > In this way, you can exlude any number of files in any fashion you
> > desire.
> Dear,
>           I have one mail server and one Backup server in which i
> daily take back up. Now if i use simple rsync command to take backup
> on back up server then it did not delete all the files from the
> backup server which does not exist on the server or you can say have
> been deleted by the users. I can use --delete option to achive this
> but i want it should delete only those files which does not exist on
> the server and 1 month old in backup server.Overallwe can have the 1
> month backup for the users mail.

Dear Sir,

Please do not top post (i have corrected the mistake in my reply to
you). Also, please be mindful to use the "Reply All" feature of your
email client (gmail) in order to keep relevant topics on the mailing

Thank you for clarifying the situation further.  I have a similar
requirement in my rsync / backup environment as well, actually.  My
solution was to use a combination of "--delete --backup
--backup-dir=<dir>/<date>".  Since my backups run once per night, <dir>
fills up with daily archives of files which would have been deleted via

Once the backups complete, i run a second script which simply deletes
any of the <dir>/<date> directories which are older than i'd like - in
my case, 15 days, in yours, ~ 30.  Simple and effective. :)

Hope that helps.

Daniel Maher <dma AT>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the rsync mailing list