<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7651.59">
<TITLE>RE: Does files-from work with --delete?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>I am trying to use rsync (3.0.6) to keep two directories as exact<BR>
duplicates. I would normally run:<BR>
<BR>
rsync -av -S --delete /path/to/src/ /path/to/dst/<BR>
<BR>
to do this. Unfortunately, the directories have become rather large<BR>
(2TB, a million files) and so the tree walk has become a prohibitively<BR>
time consuming part of the operation.<BR>
<BR>
However, I have a way to generate a list of file changes since the last<BR>
replication that is much faster. I would like to provide this list to<BR>
rsync using --files-from, but I'm not clear on how to represent<BR>
deletions. If I list the file that I know exists in the destination<BR>
that needs to be deleted (because it no longer exists in the source), I<BR>
get this:<BR>
<BR>
$ find src dst -print<BR>
src<BR>
src/a<BR>
src/b<BR>
src/c<BR>
src/c/d<BR>
src/c/a<BR>
src/p<BR>
dst<BR>
dst/a<BR>
dst/b<BR>
dst/c<BR>
dst/c/d<BR>
dst/c/a<BR>
dst/c/p<BR>
$ cat list<BR>
/p<BR>
/c/p<BR>
$ ./rsync-3.0.6/rsync -av -S --delete --files-from=list -n src/ dst/<BR>
building file list ... rsync: link_stat<BR>
"/home/ppokorny/_work/_customers/_ga/_rsync_test/src/c/p" failed: No<BR>
such file or directory (2)<BR>
done<BR>
p<BR>
<BR>
sent 61 bytes received 15 bytes 152.00 bytes/sec<BR>
total size is 0 speedup is 0.00 (DRY RUN)<BR>
rsync error: some files/attrs were not transferred (see previous errors)<BR>
(code 23) at main.c(1039) [sender=3.0.6]<BR>
<BR>
I am curious how a remote repository that is providing files-from lists<BR>
to clients would represent deletions? In the code, I can see that when<BR>
parsing the files-from list, no special handling is done when link_stat<BR>
returns a file-not-found error, which I suspect is the cause of the<BR>
message above.<BR>
<BR>
I can also imagine terrible damage that could result from enabling --del<BR>
and trusting a remote repository to provide a files-from list. But this would seem to be an<BR>
essential feature for keeping two directories equivalent using files-from.<BR>
<BR>
If modifying the file sending code to detect the link_stat "not found"<BR>
error and if --delete is enabled, sending that as a delete request (is<BR>
there such a thing in the protocol?) is the right thing, then I'll work<BR>
on a code patch.<BR>
<BR>
Thanks,<BR>
Phil P.<BR>
<BR>
--<BR>
Philip Pokorny, RHCE, Chief Arch. & Sr. Dir. HW & Field Eng.<BR>
Tel: 415-954-2823 Cell: 415-370-0835<BR>
Fax: 415-954-2899 Toll Free: 888-PENGUIN<BR>
PENGUIN COMPUTING, INC.<BR>
www.penguincomputing.com<BR>
</FONT>
</P>
</BODY>
</HTML>