Skip navigation

How do you get rsync to output a log file - don't understand the MAN pages sorry

4639 Views 2 Replies Latest reply: Feb 22, 2014 12:05 PM by tomasio RSS
Ben Sciascia Level 1 Level 1 (140 points)
Currently Being Moderated
Jul 11, 2011 5:40 PM

Hi There,


Just trying to backup our web hosting server using rsync but can't figure out how to add a log file.


The MAN pages say to use the following syntax:


rsync -av --rsync-path="rsync --log-file=/tmp/rlog" src/ dest/



But when I add that log command into my call like this:


rsync -avz -e --rsync-path="rsync --log-file=/Users/username/rsync.log" ssh user@server:/home/ /Volumes/ServerVolume/webserver-backups/LIVE/home/


I get errors and the command won't run - obviously my syntax is wrong somehow.



Does anyone know how to add a log file to an rsync command?


Any help would be much appreciated.

  • Camelot Level 8 Level 8 (45,670 points)

    If that second example is your specific entry then the answer is obvious.


    You need to more closely follow your quotes. All quotes have to be balanced (meaning that whenever you open a set of quotes there needs to be a matching close quote).


    In your case you state:


    rsync -avz -e --rsync-path="rsync --log-file=/Users/username/rsync.log"


    Note how your quotes are arranged... you're telling rsync that --rsync-path is "rsync --log-file=/Users/username/rsync.log", and there's no surprise that it fails.


    The correct format for this would be more like:


    rsync -avz -e --rsync-path="rsync" --log-file="/Users/username/rsync.log"


    (although I also question the validity of the --rsync-path command... are you sure that's right? because I'm not.


    Beyond that, though, the file arguments are incorrect - or, at least, there's a superflous 'ssh' command that's snuck its way in there somehow...

  • tomasio Level 1 Level 1 (20 points)

    Camelot was right, you do not need "--rsync-path" to output a log-file of rsync's acitivity.

    use something like:

    rsync -avz -e path/to/source path/to/destination--log-file=/Users/username/rsync.log

    No need to use quotes, Terminal escapes a space putting "\ " before a file-path containing spaces, e. g. "Your data" will be escaped as "Your\ data" automatically when you drag and drop the destination folder for the log from a Finder window to the Terminal window (=shell).


    Message was edited by: tomasio


More Like This

  • Retrieving data ...

Bookmarked By (0)


  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.