logging

Wayne Davison wayned at samba.org
Wed Jun 22 02:36:15 GMT 2005


On Tue, Jun 21, 2005 at 09:30:23PM -0400, sc0ri0n wrote:
> I simply would like to have a list of transferred files.  However,
> from wht I understand, in the way we use rsync, there is no daemon or
> any rsync server at targets.

The best way to get the list of transferred files in that case is to
specify the --log-format=FORMAT option, specify some fields that make
the names easy to parse (such as "%t %f", or "%i %n" in a modern
rsync), and then redirect the output to a file (or use the "tee"
command).  You may want to eliminate the -v option (try it and see):

  rsync -a -e rsh --log-format='%i %n' --rsync-path=/opt/bin/rsync \
    sourcedir/ user at target:/targetdir/ | tee outfile
  sed -ne 's/^<......... //p' outfile >xfered_files

Or, for an older rsync:

  rsync -a -e rsh --log-format='%t %f' --rsync-path=/opt/bin/rsync \
    sourcedir/ user at target:/targetdir/ | tee outfile
  DD='[0-9][0-9]'
  sed -ne "s;^$DD$DD/$DD/$DD $DD:$DD:$DD ;;p" outfile >xfered_files

You could also eliminate the use of the "outfile" if you don't want to
watch rsync run.

..wayne..


More information about the rsync mailing list