I would like to tar a folder into a file. This file should not be saved on the local machine but on another which can be reached via ssh.
Can I do something like that?
tar cfv ssh://user:pass@server:/tmp/myfile.tar myfolder/
Without the need of a temporary file:
tar cfv - myfolder/ | ssh user@server 'cat > /tmp/myfile.tar'
Let's try to do this the easy way. This might be a very simplistic approach, but it gets the job done.
tar cfv myfile.tar myfolder/ && scp myfile.tar user:pass@server:/tmp/myfile.tar && rm myfile.tar
(did not test this, forgive me in case it has an error)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With