--delete-before doesn't seem to actually be deleting before transfer

Matt McCutchen matt at mattmccutchen.net
Mon Jul 20 19:48:00 MDT 2009


On Mon, 2009-07-20 at 23:24 +0200, Tim Edwards wrote:
> Matt McCutchen schrieb:
> >
> > No, rsync will only do that if if you have it
> > "synchronize" /USBstick/backups/dir , i.e., specify a source directory
> > that maps to it.  Just copying several dirs _into_ /USBstick/backups/dir
> > does not do the trick.  See the description of --delete in the man page.
> >
> > Something like the following, copying the entire /local/backups/dir but
> > excluding all the backups except those you want, would work:
> >
> > rsync -av --delete-before --include=/backup1_todaysdate
> > --include=/backup2_todaysdate --include=/backup3_todaysdate
> > --exclude='/*' /local/backups/dir/ /USBstick/backups/dir
> >
> >   
> Thanks for the help but I've still had no luck with this. The command 
> now looks like:
> backupstoremove.py | rsync -av --progress --no-p --no-g --delete-before 
> --stats --include-from=- --include=/media/300GIGHD/backups/dar/restore 
> --exclude="*.dar" /media/300GIGHD/backups/dar/ 
> /media/BACKUPUSBSTICK/backups/

I forgot: the --delete-excluded option is needed so that the exclude
does not protect destination directories from deletion.  Before you give
up, you might want to try again with that option.

-- 
Matt



More information about the rsync mailing list