From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,8bdb9393eca932cf X-Google-Attributes: gidfee84,public From: dsr@mail.lns.cornell.edu (Daniel S. Riley) Subject: Re: FTP and RCP severe limitations? Date: 2000/02/28 Message-ID: #1/1 X-Deja-AN: 591039792 References: <951591946.16366.0.nnrp-06.c2deb51d@news.demon.co.uk> Organization: LNS, Cornell U., Ithaca, NY 14853 Newsgroups: comp.unix.osf.osf1 "Mark M." 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 "History teaches us that days like this are best spent in bed"