Page 1 of 1

Create a compressed archive of a folder on a remote computer

PostPosted: Fri May 06, 2005 10:53 am
by nick
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

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