reno
2007-Jul-01 19:30 UTC
%f bug in --out-format, patch for 2.6.9 ? (better mail formating)
Hello, I'm experiencing various output bugs using --out-format with %f in rsync 2.6.9 I test it with rsync 2.6.9-2 and 2.6.9-3 in debian etch, running both in deamon and client mode on the same host. This bug seems to be known by the developer as said in http://samba.anu.edu.au/ftp/unpacked/rsync/NEWS : NEWS for rsync 3.0.0 (UNRELEASED) Protocol: 30 (changed) Changes since 2.6.9: BUG FIXES: ... - Fixed a problem with the --out-format (aka --log-format) option: it would output superfluous directory information for a non-daemon rsync. Here is the output of various commands who exhibit the problem : $ pwd /home/renard/test $ ll -R * destination: total 0 -rw-r--r-- 1 renard renard 0 2007-07-01 03:44 delete.txt source: total 0 -rw-r--r-- 1 renard renard 0 2007-07-01 03:44 new.txt $ rsync -ntr --out-format="%o %f" --delete source/ destination del. home/renard/test/delete.txt (should be "del. home/renard/test/destination/delete.txt") send source/. (missing long format path) send source/new.txt (missing long format path) $ rsync -ntr --out-format="%o %f" --delete /home/renard/test/source/ destination del. home/renard/test/delete.txt (should be "del. home/renard/test/destination/delete.txt") send home/renard/test/source/. (correct) send home/renard/test/source/new.txt (correct) $ rsync -ntr --out-format="%o %f" --delete source/ /home/renard/test/destination del. home/renard/test/delete.txt (should be "del. home/renard/test/destination/delete.txt") send source/. (missing long format path) send source/new.txt (missing long format path) $ rsync -ntr --out-format="%o %f" --delete /home/renard/test/source/ /home/renard/test/destination del. home/renard/test/delete.txt (should be "del. home/renard/test/destination/delete.txt") send home/renard/test/source/. (correct) send home/renard/test/source/new.txt (correct) $ rsync -ntr --out-format="%o %f" --delete /home/renard/test/source/ 127.0.0.1::renard/destination del. home/renard/test/delete.txt (should be "del. home/renard/test/destination/delete.txt") send home/renard/test/source/. (correct) send home/renard/test/source/new.txt (correct) $ rsync -ntr --out-format="%o %f" --delete 127.0.0.1::renard/source/ destination del. home/renard/test/destination/delete.txt (correct) recv home/renard/test/destination/. (correct) recv home/renard/test/destination/new.txt (correct) Beside this output bugs, sync is functioning normally. Outputs without -n option are the sames. I'm working on a wrapper script over rsync and rsyncrypto to manage large backup, this --out-format bug prevents me from testing this further. I'm using debian stable (etch) which will probably not include rsync 3.x before lenny go stable. Working on a stable release is important to me. So my questions are : Am I talking about the same thing than in NEWS for rsync 3.0.0 ? And is there any patch available for rsync 2.6.9 to correct this bug ? Thanks, renaud Cabrol.
Matt McCutchen
2007-Jul-02 00:33 UTC
%f bug in --out-format, patch for 2.6.9 ? (better mail formating)
On 7/1/07, reno <reno@faubourg.org> wrote:> I'm experiencing various output bugs using --out-format with %f in rsync 2.6.9You seem to expect that %f will always give you an absolute path, but that's not what it is designed to do. In the rsyncd.conf man page, "long form on sender" means only that you see the source path you gave on the command line. If you want absolute paths in the log, use an absolute source path. Deletions are logged by the receiving side, and on the receiving side, %f is only meant to give you the path inside the file-list. If you want absolute paths, your script has to prepend the absolute destination path to each logged path itself, perhaps using "sed". See this thread for more information: http://lists.samba.org/archive/rsync/2007-June/017875.html> $ rsync -ntr --out-format="%o %f" --delete source/ destination > del. home/renard/test/delete.txt (should be "del. home/renard/test/destination/delete.txt")As per my comment above, the expected output path is "delete.txt", not "home/renard/test/destination/delete.txt"...> - Fixed a problem with the --out-format (aka --log-format) option: it would output superfluous directory > information for a non-daemon rsync....and that snippet refers to the bug that the "home/renard/test" part appears. The attached patch for rsync 2.6.9 fixes the bug.> $ rsync -ntr --out-format="%o %f" --delete 127.0.0.1::renard/source/ destination > del. home/renard/test/destination/delete.txt (correct)Not really; this is another example of the bug and the expected output is "delete.txt". Matt -------------- next part -------------- A non-text attachment was scrubbed... Name: log-f-fix.diff Type: text/x-patch Size: 275 bytes Desc: not available Url : http://lists.samba.org/archive/rsync/attachments/20070701/a8745c7e/log-f-fix.bin