Enno Middelberg
2009-Sep-17 18:59 UTC
rsync deletes target files after source drive failure
Hi, 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 \ /targetdir/ 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 (http://lists.samba.org/archive/rsync/2007-September/018569.html) and according to https://bugzilla.samba.org/show_bug.cgi?id=4979 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. Regards, Enno
Matt McCutchen
2009-Sep-24 02:19 UTC
rsync deletes target files after source drive failure
On Thu, 2009-09-17 at 20:59 +0200, Enno Middelberg wrote:> 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.Maybe you are hitting this issue: https://bugzilla.samba.org/show_bug.cgi?id=6719 -- Matt