Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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.

share|improve this answer
I agree with both points, based on my own experience and reading things like:… – khedron Oct 5 '12 at 16:04

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

share|improve this answer
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] – adrianmcmenamin Oct 5 '12 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. – UtahJarhead Oct 5 '12 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 – adrianmcmenamin Oct 5 '12 at 19:55
up vote 0 down vote accepted

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.

share|improve this answer

You must log in to answer this question.

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