Showing results for 
Search instead for 
Did you mean: 

transfer files

Regular Advisor

transfer files

I would like to use rsync , ssh to copy file to remote server , but I found if I add "> /tmp/log" to my rsync , ssh command , it will not output what file is tranferred to remote server to /tmp/log , can advise if I want to have a file transfer log so that I can trace the problem , what can i do ?

if I only want to output the transferred file name , not includes the transfer speed , file size , what can I do ? thx
Honored Contributor

Re: transfer files

Use the "--log-format" option to format the file transfer log as you wish. See "man rsyncd.conf" to see all the possible log format keys.

For example:
rsync --log-format='%f' somefile.txt somehost: >rsync.log

will output to rsync.log:

NOTE: rsync will list the filename also if the file already exists in the destination. In this case, rsync only transfers a bit of metadata (file modification time, checksum) to allow the receiving end to verify that the file is the same and no transfer is needed.

Court Campbell
Honored Contributor

Re: transfer files

In keeping with Matti's theme. You can also just add --log-file=FILE to the rsync command.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"