Luke,

Nope, this was the exact thing we were trying to get away from.  Suppose I
don't have space to store that file on the host box.  We're doing it in
stages now and I really want to get away from that since it increases disk
activity on the host box during a full backup.  Considering these are web
servers I want to keep the disk activity as low as possible during the
backup, if for nothing else than saving the wear and tear on these disks
that are spinning 24/7/365 as it is.  We almost moved the gzip to the backup
server also but then we decided that that would put too much burden on the
backup server it's self (since the backup server may actually be backing up
multiple servers at a time).  I can do this on the command line with a
simple:

ssh 1.1.1.1 "tar -cf - /home/$user | gzip" > /tmp/$user.tar.gz

It seems to go straight to disk then, but I didn't like the idea of using
that type of redirect here (and I'm not even sure if it's possible to do
that properly in a perl script, besides that's not a very 'perl' way of
doing it :-).

Thanks,
Tim

-----Original Message-----
From: Bakken, Luke [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 17, 2004 12:48 PM
To: tyohn; [EMAIL PROTECTED]
Subject: RE: Writing output of a Shell command directly to a file

> @in = ssh("1.1.1.1", "tar cf - /home/$user | gzip")
> open(TEMP, ">/tmp/$user.tar.gz") or die "Blargh!";
> print TEMP @in;
> close(TEMP);

Can you do this in stages?

Create tar file:
ssh("1.1.1.1", "tar cf - /home/$user | gzip -c | dd of=/tmp/foo.tgz")

Use ftp or scp to get it to your backup machine.

Delete /tmp/foo.tgz on original machine.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>






-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to