Bug 4856 - Filenames are displayed before successful transfer in verbose mode
Filenames are displayed before successful transfer in verbose mode
Status: RESOLVED WONTFIX
Product: rsync
Classification: Unclassified
Component: core
2.5.7
All Linux
: P3 normal
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-03 03:24 UTC by Robert Masters
Modified: 2007-08-03 19:40 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 Robert Masters 2007-08-03 03:24:41 UTC
Rsync displays the filenames to be transfered before a successful transfer occurs. This can cause issues when analysing output for auditing.

To replicate: 
On node a:
mkdir -p /tmp/qq/
touch /tmp/qq/zzz

On node b:
mkdir -p /tmp/qq

On node a:
rsync -pogtv --rsh="ssh -2" -T /tmp/qq/temp /tmp/qq/* b:/tmp/qq |while read file ; do echo "**** $file" ; done

Note that file zzz appears to have been transferred, when it in fact has not.

Can the file be displayed only after successful transfer?
Comment 1 Matt McCutchen 2007-08-03 10:46:55 UTC
Rsync always outputs the filename to the console before the transfer to inform the  user of what file it is working on.  If you specify a log file with --log-file=FILE , rsync will write the filename to the log file after a successful transfer.  If you want the filename to appear on the console after the transfer, you can redirect rsync's stdout to /dev/null and specify --log-file=/dev/tty .

This is not a bug; you're asking for help doing something.  Next time, please ask on the mailing list, rsync@lists.samba.org .
Comment 2 Wayne Davison 2007-08-03 19:40:19 UTC
Note that the --out-format (formerly --log-format) option can also be used to get file information at the end of the transfer, as mentioned in the manpage (and the -v option points you at the --out-format option, since they two are related):

 Rsync will output the out-format string prior to a  file’s  transfer  unless
 one  of  the  transfer-statistic escapes  is  requested,  in  which case the
 logging is done at the end of the file’s transfer.  When this late logging is
 in effect and --progress is also specified, rsync will also output  the  name
 of  the  file  being transferred prior to its progress information (followed,
 of course, by the out-format output).

This method works with older rsync versions that don't support --log-file.