From: dsr@mail.lns.cornell.edu (Daniel S. Riley)
Subject: Re: FTP and RCP severe limitations?
Date: 2000/02/28 [thread overview]
Message-ID: <sh66v9ynw6.fsf@lns130.lns.cornell.edu> (raw)
In-Reply-To: PEAu4.14973$mK.1097126@brie.direct.ca
"Mark M." <anonymous@westshore.com> writes:
> Can I 'tar' the files to a single tar file rather than tape. Then
> copy the single tar file to the other machine. Then un-tar it?
> Presently I tar it to tape, then drive the tape to the other
> machine, hook it up, then read it from tape.
Sure--just do something like
tar cf archive.tar subdir
That tar's everything in the directory 'subdir' into a file called
archive.tar (make sure you don't write the tar file to the directory
that you are archiving--or it may try to archive itself!). rcp or ftp
that to the remote system, and untar it with
tar xf archive.tar
You can even eliminate the intermediate file (this is a more advanced
Unix idiom--you might want to experiment a bit to get comfortable with
the concepts before trying this in a production environment):
tar cf - subdir | rsh remotehost '(cd /path/on/remote/host ; tar xf -)'
That tar's up subdir and writes it to stdout, which is piped into an
rsh to remotehost. The shell on remotehost cd's to /path/on/remote/host,
and unpacks stdin (your tar "file"!) into /path/on/remote/host/subdir.
If you have a slow link and fast cpu's, you can compress it along the
way
tar cf - subdir | compress | \
rsh remotehost '(cd /path/on/remote/host ; zcat | tar xf -)'
Pipes let you do all sorts of tricky things--learning a few of the
common idioms can save you a lot of work.
--
Dan Riley dsr@mail.lns.cornell.edu
Wilson Lab, Cornell University <URL:http://www.lns.cornell.edu/~dsr/>
"History teaches us that days like this are best spent in bed"
next prev parent reply other threads:[~2000-02-28 5:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-26 5:00 FTP and RCP severe limitations? Mark M.
2000-02-26 5:00 ` Bob Harris
2000-02-26 5:00 ` Adam Price
[not found] ` <shu2iuh8v5.fsf@lns130.lns.cornell.edu>
2000-02-27 5:00 ` Adam Price
2000-02-28 5:00 ` Mark M.
2000-02-28 5:00 ` Jack Patteeuw
2000-02-28 5:00 ` Daniel S. Riley [this message]
2000-02-29 5:00 ` Joerg Bruehe
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox