I'm using rsync to backup multiple directories, i.e. rsync -azq --delete --relative /dog /cat /fish user@rsync-server::modulename Everything works fine, except if I remove a directory from the list of those being backed up, it isn't deleted on the other side. For example: rsync -azq --delete --relative /dog /cat /fish user@rsync-server::modulename /dog /cat /fish are all backed up to the remote server. rsync -azq --delete --relative /dog /cat user@rsync-server::modulename /dog and /cat are backed up, /fish isn't deleted. I realize this behaviour is probbably by design but is there a way to get rsync to delete directories no longer being backed up?
On Mon 01 Nov 2004, Steve Sether wrote:> I'm using rsync to backup multiple directories, i.e. > rsync -azq --delete --relative /dog /cat /fish user@rsync-server::modulename > Everything works fine, except if I remove a directory from the list of > those being backed > up, it isn't deleted on the other side. For example:[...]> I realize this behaviour is probbably by design but is there a way to > get rsync to > delete directories no longer being backed up?Perhaps use --delete-excluded and --exclude the directory? Paul Slootman
On Mon, Nov 01, 2004 at 09:30:10PM -0600, Steve Sether wrote:> I realize this behaviour is probbably by design but is there a way to > get rsync to delete directories no longer being backed up?Yes, it is by design since you just omitted the directory in the arg list, and rsync can't assume it should delete args that don't get mentioned on successive commands. Rsync only deletes inside directories that it sends, so either put the items you want to backup into a single directory and send that single directory (perhaps using excludes to avoid sending too many dirs), or see the following message for how to delete things remotely: http://www.mail-archive.com/rsync@lists.samba.org/msg11823.html ..wayne..