logging

sc0ri0n sc0ri0n at comcast.net
Wed Jun 22 03:09:51 GMT 2005


On Tue, 2005-06-21 at 19:36 -0700, Wayne Davison wrote:
> 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..

Thanks again.  I will try it.  I was trying to avoid |tee as it was not
suitable in the script we are using but it seems like I have to.  I wish
a simple --log-file:<output> did exist in rsync.

Thanks,
Adil



More information about the rsync mailing list