Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I wanted to do something like this:
Take a local directory,
- tar gzip/bzip2 it
- ssh + cat it to a remote machine
The only problem is, the only guide I found on the 'net was
Code:
Backup with local compression and remote storage
tar cf - dirname | gzip -c | ssh remotehost "cat > ${TMPFILE}.tar.gz"
which seems to require a temp file. Or am I misinterpreting this, and that ${TMPFILE} is the name of the file to be created on the remote machine? (It is an environment variable in the guide).
I can't use a local temp file expressly because the resulting tgz > free space.
Sorry for the banal question, I've never been really good with piping. *blush*
Last edited by michaelsanford; 02-08-2006 at 03:28 PM.
I'd imagine that using "tar cjf" would work - the "j" flag adds bzip2 compression, as shown in the tar man page. . . Altho I believe the example you show is indeed making the TMPFILE file at the remote site. Just swapping "gzip" for "bzip2" would probably work
Last edited by oneandoneis2; 02-08-2006 at 03:57 PM.
For moving directories (and subdirectories) between computers, I like to use scp , like this: scp -pr /path/to/directory hostname:/path/to/destination
Or, if you just want to move one file: scp -p /path/to/file hostname:/path/to/destination
Hope this helps.
tredegar, satinet, thanks for your replies but you probably glanced over my original post a little quickly I needed a way to pipe a local folder to a tar.gz on a remote machine, like oneandoneis2 and born4linux mentioned.
Thanks to all who replied, of course!
PS For other things, I love scp, it's great, too bad it doesn't compress inline.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.