old files not getting deleted

Matt McCutchen matt at mattmccutchen.net
Wed Feb 17 14:45:20 MST 2010

On Sat, 2010-02-13 at 18:56 -0500, Charles Sprickman wrote:
> I've been having a bear of a time tracking this down.  I'm currently using 
> rsync to back a bunch of servers up to a ZFS pool on a server.  I recently 
> noticed my deltas between ZFS snapshots seemed a bit large, so I started 
> looking more closely at what was being backed up.  Looking at some Maildirs, I 
> found that messages (files) that had been deleted on the server were not being 
> deleted by rsync.  My flags include a "--delete" option, and I also tried the 
> other delete options (delete-during, delete-after) with no luck.
> If I manually run rsync with the same flags, but specify the direct path to a 
> user's Maildir, files are deleted properly.  My script runs from the root of 
> the filesystem though, and relies on an included exclude file to negate things 
> I don't want to back up.

> rsync --archive --stats --numeric-ids --delete --partial --inplace --hard-links 
> --exclude-from=/usr/local/rsb/conf/exclude.default.fbsd 
> --rsync-path="/usr/local/bin/rsync" --rsh="/usr/bin/ssh -p 22 -i 
> /usr/local/rsb/conf/id_dsa" --log-file=/var/log/rsbackup/$RSYNC_SERVER.log
> backups@$RSYNC_SERVER:/ /tank/backups/$RSYNC_SERVER (note, no trailing slash on 
> destdir)

Maybe you are getting an I/O error.  By default, rsync skips all
deletion of destination files when it gets an I/O error on the source,
to avoid erroneous deletion of destination files if the I/O error caused
them to be omitted from the file list.  (This is a very blunt measure
and making it more granular would be a good enhancement request, but
really the user should address the cause of the I/O errors.)  Look at
rsync's output to stderr, and also look for a message "IO error
encountered -- skipping file deletion".


More information about the rsync mailing list