Tar and Restore Files Over SSH
This will be pretty obvious to seasoned *nix admins but it’s possible to tar/gz/bzip files over an ssh connection onto a remote file system. Read on to find out how…
Simply start out within an ssh session on the machine youre sending data FROM:
tar cjvf - /home | ssh root@backup.pixelchaos.net "cat > /backup/home.tar.bz2"
You can also use dd (or any other data/pipe handling commands):
tar cjvf - /home | ssh root@backup.pixelchaos.net "dd of=/backup/home.tar.bz2"
To restore that same file over ssh:
ssh root@backup.pixelchaos.net "cat /backup/home.tar.bz2" | tar xjvf -
[...] http://www.pixelchaos.net/index.php/archives/22 [...]