Hi there, I am using rsync to synchronize two folders. I have configured the log-format to my personal needs like this: --log-format="%f %t %o %l %P" I am also using the --delete flag to log deleted files as well. I have upgraded my rsync version to 2.6.9 when I figured out that starting with version 2.6.4 the log format had been enhanced to also include the "del." operation. I am parsing the log file in a subsequent java program and that is where I ran into a problem: In the log file all lines with deleted files do not show the full path to the deleted files but show the path of where I ran the rsync command and the deleted file name. Example: source_dir/test1 destination_dir/test1 Now I delete the file test1 in source_dir and run rsync in the directory "script" Then I would expect in the log file a line like: source_dir/test1 2006/12/21 18:49:58 del. 0 but I get: script/test1 2006/12/21 18:49:58 del. 0 Is this a bug or am I the bug ? I have checked the manuals and the bugzilla pages as well as the mailing archives but could not find anything. Jens -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal f?r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
Matt McCutchen
2006-Dec-23 03:36 UTC
log file with unexpected output on deleted files (bug?)
On 12/21/06, Jens Helweg <helweg@gmx.de> wrote:> In the log file all lines with deleted files do not show the full path to the deleted files but show the path of where I ran the rsync command and the deleted file name.I can reproduce this behavior, and I think it's a bug. Rsync should use the path to the destination directory as given on the command line, not the absolute path to its working directory. Matt
Wayne Davison
2006-Dec-23 15:58 UTC
log file with unexpected output on deleted files (bug?)
On Thu, Dec 21, 2006 at 07:21:34PM +0100, Jens Helweg wrote:> In the log file all lines with deleted files do not show the full path > to the deleted files but show the path of where I ran the rsync > command and the deleted file name.This is due to a bug-fix to help an rsync daemon log where the files are in the hierarchy, but it's being applied to non-daemons where it is causing a problem with the output (which affects more than just deleted files). The fix is as simple as the appended patch. Thanks for the bug report! ..wayne.. -------------- next part -------------- A non-text attachment was scrubbed... Name: log-f.patch Type: text/x-diff Size: 348 bytes Desc: not available Url : http://lists.samba.org/archive/rsync/attachments/20061223/4c9bb61d/log-f.bin
On Sat, 23 Dec 2006 07:58:29 -0800 Wayne Davison wrote: This is due to a bug-fix to help an rsync daemon log where the files are in the hierarchy, but it's being applied to non-daemons where it is causing a problem with the output (which affects more than just deleted files). The fix is as simple as the appended patch. Thanks for the bug report! ..wayne.. --- log.c 17 Dec 2006 00:40:36 -0000 1.169 +++ log.c 23 Dec 2006 15:56:30 -0000 @@ -525,7 +525,7 @@ static void log_formatted(enum logcode c n = c; } else n = buf2; - } else if (*c != '/') { + } else if (am_daemon && *c != '/') { pathjoin(buf2, sizeof buf2, curr_dir + module_dirlen, c); clean_fname(buf2, 0); -- Thanks for the patch. I could not find a release plan or anything to tell me when 2.6.10 will be released ? Is this already scheduled ? Jens