Skip to content

Quick Rsync Question

I have a windows batch file that runs rsync to backup some directories from my machine to a remote server. I have a slight problem, though, in that two of the rsync commands are only bringing the last directory. For example, if I have the following commands in my batch file:

CODE:
  1. rsync -alogvqrtz --delete -e "ssh -p ####" "/cygdrive/c/Users/username/AppData/Local/Microsoft/Outlook" username@somehost.com:/home/username/backup/
  2.  
  3. rsync -alogvqrtz --delete -e "ssh -p ####" "/cygdrive/c/Users/username/AppData/Roaming/.purple" username@somehost.com:/home/username/backup/

I want to create the directory path that is being backed up, but this command is not doing it. Is there another switch I need to include or am I doing something a bit wrong?

{ 7 } Comments

  1. Paul | October 4, 2007 at 11:21 pm EDT | Permalink

    Try dropping the 'q' parameter and you might notice an error. Also I'd suggest using a key for authentication rather than embedding a password in the command. And maybe adding a '-v' to the ssh command to make sure it is working.

    The good news is he syntax looks right and a quick try with OS X to FreeBSD resulted in the command working.

  2. JJT | October 4, 2007 at 11:27 pm EDT | Permalink

    Paul: The command works swimmingly, and the ssh connection works as expected. My host runs SSH/SFTP on a non-standard port. That said, I also have the keys on the destination machine. ;-) Something I did right, but slightly different from some other documentation I saw online. (There's a huge write-up of this coming.)

    I will try dropping the -q parameter and see what happens. Time for bed for now.

  3. Paul | October 4, 2007 at 11:39 pm EDT | Permalink

    quick thought, what about permissions on the remote machine? make sure you can create a destination directory.

  4. George | October 7, 2007 at 9:38 am EDT | Permalink

    I have a suggestion: Stop using Windows. :-)

  5. Paul | October 7, 2007 at 10:14 am EDT | Permalink

    Have you figured this out yet?

  6. JJT | October 7, 2007 at 7:14 pm EDT | Permalink

    George: Windows has nothing to do with it. Apple nerd! ;-)

    Paul: The -q option seems to work, but it just created the root directory I am backing up. It's not that bad, but just thinking of this as kind of a disaster recovery scenario. At the end of the day, if it backs up my Outlook PST, that works for me.

  7. Paul | October 8, 2007 at 9:16 am EDT | Permalink

    The suggestion for dropping -q (--quiet) was that it might be suppressing an error that would help you track down the problem.

    You know if you don't want to switch to OS X you can always switch to linux. Of course then you might have to stop your metrosexual tendencies in order to better fit in wit that crowd. ;-)

Post a Comment

Your email is never published nor shared. Required fields are marked *