Create a compressed archive of a folder on a remote computer

This uses a LiveCD, SSH, and tar. This is very useful when recovering files from a broken Windows machine. It also works without the LiveCD on any computer with SSH and tar.
create an archive of the folder /home/bob on a remote computer "remote" called bobhome.tgz
and the restore it back to the computer you are on
or, if you moved to your server, unarchive the files and push them to a remote computer
create an archive of the folder /home/bob on a remote computer "remote" called bobhome.tgz
- Code: Select all
tar zcvf - /home/bob | ssh user@remote "cat > bobhome.tgz"
and the restore it back to the computer you are on
- Code: Select all
ssh user@remote "cat bobhome.tgz" | tar zpvxf -
or, if you moved to your server, unarchive the files and push them to a remote computer
- Code: Select all
ssh user@remote "cd /home/bob; tar zpvxf -" < bobhome.tgz