Subject: Re: on-shot tar&ftp
To: Joel CARNAT <joel@carnat.net>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: netbsd-users
Date: 12/09/2004 18:56:58
On Wed, Dec 08, 2004 at 06:54:01PM +0100, Joel CARNAT wrote:
> Hi,
> 
> I want to send a tarball through FTP "on the fly".
> I can't tar on local machine first (because I boot from CD, got a
> shell and am trying to tar the whole installed / to a backup server), so
> I have to tar and ftp_put on the fly. I saw (while pkg_adding) that you
> can ftp_get and untar on the fly, but how to do the same thing the other way ?
> 
> seen on pkg_add :
> ftp> get xv-3.10anb7.tgz "| ( cd /var/tmp/instmp.15276b ; gunzip 2>/dev/null | tar -vvx -f - | tee /dev/stderr )"
> 
> I tried :
> ftp> " ( tar cf - . | gzip -c - ) " | put me.tar.gz
> ftp> " ( tar cf - . | gzip -c - ) |" put me.tar.gz
> 
> but both fail with "command not found".

How about something like

% cat>/tmp/cmds
user myuserid
cd /bigdisk_on_server
put - installedroot.tgz
^D
% (cat /tmp/cmds; tar -czf - /) | ftp -n some.other.server

(from distant memory...)

Cheers,

Patrick