rsync deletes target files after source drive failure

Enno Middelberg enno.middelberg at
Thu Sep 17 12:59:10 MDT 2009


I'm making backups using rsnapshot via cron jobs. Recently the source
drive died. rsync wasn't able to read the source data and subsequently
deleted the target directory. Here is part from the log:

/usr/bin/rsync -avi --delete --numeric-ids --relative --delete-excluded \
    --stats --exclude-from=/redgum-backup/emiddel/rsync-excludes \
    --rsh=/usr/bin/ssh xxx at yyy:/srcdir \
receiving incremental file list
rsync: readdir("/data/1934-638.1344.04nov27"): Input/output error (5)
rsync: readdir("/data/1934-638.1344.04nov28"): Input/output error (5)
deleting data/1934-638.1344.04nov27/visdata
deleting data/1934-638.1344.04nov27/vartable
deleting data/1934-638.1344.04nov27/leakage
deleting data/1934-638.1344.04nov27/history
deleting data/1934-638.1344.04nov27/header
deleting data/1934-638.1344.04nov27/gains
deleting data/1934-638.1344.04nov27/flags
deleting data/1934-638.1344.04nov27/bandpass
deleting data/1934-638.1344.04nov28/visdata
deleting data/1934-638.1344.04nov28/vartable
deleting data/1934-638.1344.04nov28/leakage
deleting data/1934-638.1344.04nov28/history
deleting data/1934-638.1344.04nov28/header
deleting data/1934-638.1344.04nov28/gains
deleting data/1934-638.1344.04nov28/flags

Here the two directories which couldn't be read have been deleted from
the target directory (ie, the files contained in them were deleted,
the directories did still exist, if I remember correctly). If I
understand the man page correctly, rsync should not delete files from
the target directory when an error occurs. This can be overridden with
the "--ignore-errors" command line switch, but this switch has
definitely not been used.

This error appears to be very similar to what has been reported on two
years ago (
and according to
should have been fixed, but apparently isn't.

Or am I completely missing something?

I'm using Ubuntu 9.04, rsync  version 3.0.5,  protocol version 30.



More information about the rsync mailing list