I am using the --log-file option in rsync to see the logs. But when I tried to run, it says:

 --log-file unrecognized option

Here is my command:

#/usr/bin/rsync -av -u --log-file="/sreeni/log.txt" --rsync-path=/usr/local/bin/rsync /sreeni nnmhpt20.ind.hp.com:/sreeni

could some one help me with the right syntax ?

I tried these options also.

#/usr/bin/rsync -av -u --log-file /sreeni/log.txt --rsync-path=/usr/local/bin/rsync /sreeni nnmhpt20.ind.hp.com:/sreeni

and

#/usr/bin/rsync -av -u --log-file="/sreeni/log.txt" --rsync-path=/usr/local/bin/rsync /sreeni nnmhpt20.ind.hp.com:/sreeni
link|improve this question
feedback

migrated from stackoverflow.com Nov 12 '11 at 13:11

This question came from our site for professional and enthusiast programmers.

1 Answer

Which is your distro? For an agnostic distro aproach you can use simple output redirection.

rsync your_chosen_options >> chosen_logfile 2>&1

which turns into,

/usr/bin/rsync -av -u /sreeni nnmhpt20.ind.hp.com:/sreeni >> /sreeni/log.txt 2>&1

Anyways for Debian based boxes, this seems to work,

rsync -av -u --log-file=/var/log/atest.log SRC DEST 2>&1 1>/dev/null

whereas for RHEL I needed,

rsync -av -u SRC DEST 1>>/var/log/atest.log 2>/dev/null
link|improve this answer
feedback

Your Answer

 
or
required, but never shown