I am seeking to back up an encrypted volume used by Virtual Box on one OS X machine to another using rsync (I will eventually stick this into cron).

This is the command line (I am sharing public keys so no password is required) - with some details obscured:

    rsync --bwlimit=100 -av -e "scp -P [port numb] user@address:~/VirtualBox\ VMs/ubuntu1/*" ./ubuntu1/.

But it won't copy anything, just repeatedly giving me this, ie no copying is done - despite the fact that ubuntu1.vdi date stamp and size have now changed:

    building file list ... done 
    drwxr-xr-x         170 2012/10/04 19:06:15 .
    -rw-------        7265 2012/10/05 10:00:21 ubuntu1.vbox
    -rw-------        7265 2012/10/05 10:00:21 ubuntu1.vbox-prev
    -rw-------  7881625600 2012/10/05 10:53:23 ubuntu1.vdi

    sent 132 bytes  received 20 bytes  304.00 bytes/sec total size is 7881640130
    speedup is 51852895.59

How do get this to work properly?

3 Answers 3

rsync --bwlimit=100 -av -e "ssh -p[port numb]" user@address:"~/VirtualBox\ VMs/ubuntu1/" ./ubuntu1

Don't use scp within an rsync command. It won't get you very far. Also, consider using the full path and not ~. It does not always get translated properly.


there is no need to write more inside -e than "ssh -P 1234"

 rsync --bwlimit=100 -av -e "scp -P [port numb]" \
    user@address:~/VirtualBox\ VMs/ubuntu1/* \

should work

  • I assume you mean "scp" inside the comments? As ssh inside just bombs. Using scp doesn't work either: usage: scp [-1246BCEpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2 rsync: connection unexpectedly closed (0 bytes received so far) [receiver] rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-42/rsync/io.c(452) [receiver=2.6.9] Oct 5, 2012 at 13:46
  • No, you do not use scp inside of the rsync command. rsync transfers over ssh. It does not use scp as well. Oct 5, 2012 at 15:57
  • yes, the reason why it failed was the path though - I have to have inverted commas around that too, because of the space. Works now Oct 5, 2012 at 19:55

This works:

    rsync --bwlimit=100 -av -e "ssh -p [port]" "user@address:~/VirtualBox\ VMs/ubuntu1/*" ./ubuntu1/.

Thanks for the above comments, but it turned out it was wrong to state I only had to enclose the ssh command because the odd path would break the transfer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .