Bug 3214 - --ignore-errors only ignores but does not delete
Summary: --ignore-errors only ignores but does not delete
Status: CLOSED WORKSFORME
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.6
Hardware: x86 Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
: 3215 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-25 20:52 UTC by mark heather
Modified: 2006-03-12 03:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mark heather 2005-10-25 20:52:55 UTC
if I
{
 rsync --files-from=.rsync -ruvvvv --delete --ignore-errors transfer/ 
192.168.10.190::transfer/
opening tcp connection to 192.168.10.190 port 873
opening connection using --server -vvvvurR --delete --ignore-errors . 
transfer/ 
(Client) Protocol versions: remote=27, negotiated=27
building file list ... 
[sender] make_file(fil1.txt,*,2)
[sender] make_file(fil2.txt,*,2)
rsync: link_stat "/home/mark/transfer/fil3.txt" failed: No such file or 
directory (2)
[sender] make_file(fil4.txt,*,2)
[sender] make_file(fil5.txt,*,2)
[sender] make_file(fil6.txt,*,2)
[sender] make_file(fil7.txt,*,2)
done
[sender] i=0 <NULL> fil1.txt mode=0100644 len=0 flags=0
[sender] i=1 <NULL> fil2.txt mode=0100644 len=0 flags=0
[sender] i=2 <NULL> fil4.txt mode=0100644 len=0 flags=0
[sender] i=3 <NULL> fil5.txt mode=0100644 len=0 flags=0
[sender] i=4 <NULL> fil6.txt mode=0100644 len=0 flags=0
[sender] i=5 <NULL> fil7.txt mode=0100644 len=0 flags=0
send_file_list done
file list sent
send_files starting
send_files phase=1
send files finished
total: matches=0  tag_hits=0  false_alarms=0 data=0

sent 99 bytes  received 12 bytes  222.00 bytes/sec
total size is 0  speedup is 0.00
_exit_cleanup(code=0, file=main.c, line=791): entered
rsync error: some files could not be transferred (code 23) at main.c(791)
_exit_cleanup(code=0, file=main.c, line=791): about to call exit(23)
}

where .rsync contains all of the files (but not the directories) last copied.
I do now want to include directories in the .rsync file
fil3.txt is not deleted from the 192.168.10.190

The total batch file is
#!/bin/bash

SERVER=192.168.10.190
rsync --files-from=.rsync -aruv --delete --ignore-errors --existing 
~/transfer/ $SERVER::transfer/
rsync -LrPvz --delete $SERVER::transfer/ ~/transfer/
rsync -r --list-only --log-format=%L ~/transfer/ ~/transfer/ | grep --
regexp='^-' | cut -c 44- > .rsync

Unless I am missing something the batch file should allow files deleted from 
the ~/transfer/ to be deleted from $server::transfer/

I am having problems with the first rsync command

If I remove the --ignore-errors, it mentions that an IO error has occured - 
skipping file deletion.

If this is a problem in my understanding of rsync, I am terribly sorry.
Comment 1 Wayne Davison 2005-10-26 09:24:44 UTC
*** Bug 3215 has been marked as a duplicate of this bug. ***
Comment 2 Wayne Davison 2005-10-26 09:32:35 UTC
Keep in mind that the only deletions rsync ever does are in directories that
rsync sends, so if -r is specified and the files-from list contains a directory
name, deletions will occur in that directory's hierarchy (future versions of
rsync will also delete in directories that were transferred with -d w/o -r).

If you're expecting a missing file to turn into a delete, that will not work. 
You'll need to get individual deletions to the remote host in some other way. 
There has been discussion on how to do this on the mailing list (e.g. using ssh
+ xargs, and a method using just rsync with some include/exclude rules).