I'd like to essentially tar/gz a directory on a remote machine and save the file to my local computer without having to connect back into my local machine from the remote one. Is there a way to do this over SSH? The tar file doesn't need to be stored on the remote machine, only on the local machine. Is this possible?
Bash SSH Tar – How to Compress a Directory Using Tar/Gz Over SSH to Local Computer
bashsshtar
Best Answer
You can do it with an ssh command, just tell
tar
to create the archive on its standard output:Another approach, which is more convenient if you want to do a lot of file manipulations on the other machine but is overkill for a one-shot archive creation, is to mount the remote machine's filesystem with SSHFS (a FUSE filesystem). You should enable compression at the SSH level.