Bug 8558 - display daemon-only --out-format values in a less confusing manner
Summary: display daemon-only --out-format values in a less confusing manner
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.6
Hardware: x64 Linux
: P5 enhancement (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2011-11-01 00:56 UTC by Kym
Modified: 2011-11-02 23:21 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Kym 2011-11-01 00:56:37 UTC
According to the rsync manpage, the --out-format <FORMAT> switch supports the single character escapes listed under the 'log format' options in rsyncd.conf manpage, however for my version of rsync some of the escapes don't work.

In this specific case : %a, %h, %P, %u are not expanded.

example :

[tiris@sts-dev tg_sync]$ rsync -tr -v --out-format "%a %b %B %c %f %G %h %i %l %L %m %M %n %o %p %P %t %u %U"  rsync://user@tg-b1.aad.gov.au/log /cifs/tiris/tg-b1

receiving file list ... done
%a 1089 rw-rw-r-- 0 rsyncd DEFAULT %h >f.st...... 69953   2011/11/01-00:55:24 rsyncd recv 10013 %P 2011/11/01 00:55:26 %u 0
%a 2889 rw-rw-r-- 0 tg DEFAULT %h >f.st...... 15377   2011/11/01-00:55:00 tg recv 10013 %P 2011/11/01 00:55:26 %u 0

sent 823 bytes  received 4541 bytes  975.27 bytes/sec
total size is 680044  speedup is 126.78
[tiris@sts-dev tg_sync]$

$ rsync --version
rsync  version 3.0.6  protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
    64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes
Comment 1 Wayne Davison 2011-11-01 23:40:57 UTC
This is how rsync displays a value that is null (undefined) -- it displays the escape that is not defined.  In all the escapes you cited, they are you defined in a daemon, so the non-daemon side has no data to output for them.  If you use them in the daemon's output, they would display the expected information.

So, is the current practice the right one?  I want rsync to display something for an undefined field, since displaying nothing at all can make the parsing of the columns not match up right.  We could have it display "(null)" or "<empty>" or some such value, which might be better.
Comment 2 Kym 2011-11-02 23:21:15 UTC
My expectation was that for the non-daemon rsync,  the %a and %h would indicate the remote IP (if one) was being used, which was useful in the situation where I am performing a pull rsync with a non-daemon rsync from many remote systems (running the daemon) to one local repository.  currently I'm having to emit the host name in the bash script that rsync is working with. 


(for loop)
echo $HOST
rsync -tr -v --out-format rsync://user@$HOST/log <dest>
(end loop)

It's not a biggie.. I just thought the %a and %h in the --out-format could do that automatically for me.

I'm not sure what might be work emitting if the value is empty.. besides perhaps making the distinction in the manpages a bit clearer as to which is supported in daemon and non-daemon.