April 26, 2007

tar over SSH (part 2)

Drew Stephens @ 9:50 pm — Tags:

In our last episode we used tar to move a file structure across the network. This time, to create a tarball directly onto another machine the following command can be used:

tar czf - foo/ | ssh user@host "cat > /path/to/foo.tgz"

This is useful if the machine you’re taring from doesn’t have enough disk space to hold the tarball. Furthermore, it’s probably faster because the tarball is only being written once, directly to its final location.

Related Posts:

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress