I am trying to backup a remote server to my machine. I am trying something like
ssh user@ip "dd if=/dev/sda" | dd of=~/backup.img
But that obviously doesn't work. Other variants that don't work.
ssh user@ip "sudo dd if=/dev/sda" | dd of=~/backup.img
ssh user@ip -t "sudo dd if=/dev/sda" | dd of=~/backup.img
I have public key authentication set up. Note that even after compression, the remote machine can not hold its own backup. What do I do?
(Note in the long run I want to try and put this in an automatic script, but I just want a backup for now.)
Note: I should mention that I don't want to just back up the files (like with rsync) but to have a complete image that I can just drop on a new hard-drive should this one go belly up with little hassle.