Subject: Re: on-shot tar&ftp
To: Joel CARNAT <joel@carnat.net>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-users
Date: 12/10/2004 00:38:02
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".

I think this should work:
tar czf  - . | ftp -u ftp://some_host/some_path/me.tar.gz

If anonymous access doesn't work, the user:pass@some_host syntax should work in
the URL.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--