Sam's Tech Blog

You can check out any time you like, But you can never leave!'

2019-08-21

Backup over SSH using DD

How to: Backup over SSH using DD

Backup over SSH using DD

Backup a remote computer's HDD "sda" via SSH to a single file that's on your local computer's HDD.

If run from remote computer ie. Host

$ dd if=/dev/sda | gzip -1 - | ssh user@local dd of=image.gz

If run from local computer ie. Client

$ ssh user@remote "dd if=/dev/sda | gzip -1 -" | dd of=image.gz