Jaimee,
I have a dedicated backup server to work with. And backing up the home directory
on a remote web/db server. I figured I save some energy on the web/db server by
compressing the data on the backup server. Plus saving the space on the web/db server
by piping to stdout.
Dependiong on the sixe of the user directory load average can go up pretty high
with the -z option in tar on the web/db server.
Thanks for the input though......
--chad
On Tue, 14 May 2002 09:39:49 -0700
Jaimee Spencer <[EMAIL PROTECTED]> wrote:
> Hello Chad,
>
> Why not just use z as part of your tar command? (E.g. tar zcpf) no -
> in the command.
>
> Regards,
> Jaimee
>
> -----Original Message-----
> From: chad kellerman [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 14, 2002 7:14 AM
> To: [EMAIL PROTECTED]
> Subject: Backup script using other modules.
>
>
> Hello everyone,
>
> I am a little new to perl. I am writing a little backup script using
> Net::SSH:Perl, Compress::Zlib and FileHandle.
>
> I am just tarring up users in the home directory. ( Ohh I am runnng
> Linux)
> I have most of the script working except Compress standard out from my ssh
> command.
>
> Can anyone offer any suggestions??
> <snip>
>
> foreach $home_user (@home_users) {
>
> my($tar_out, $tar_err) = $ssh->cmd("cd /home; /bin/tar cpf -
> $home_user");
> my $gz_file->gzopen($tar_out, "rb") or die " Cannot open $tar_out:
> $gzerrno\n";
> while (<>) {
> $gz_file->gzwrite($_)
> or die "error writing: $gzerrno\n" ;
> }
>
> my $gz_user = new FileHandle "/backup1/$home_user\.tar.gz", "w";
> $gz_user->print($gz_file);
> # for error logging...
>
> my $tar_err_log = new FileHandle "/var/log/tar_error.log", "w";
> $tar_err_log->print($tar_err);
> $tar_err_log->close;
>
> $gz_file->gzclose;
> $gz_user->close;
>
> undef $tar_out;
> undef $tar_err;
> undef $gz_file;
> }
>
> </snip>
>
> I can connect fine and just copy the tar ball aver. But I want to gzip
> the tar ball also. It keeps on dying saying
>
> Can't call method "gzopen" on an undefined value at tadpole.pl line such and
> such.
>
> But I thought I defined it when I say my($tar_out, $tar_err) = $ssh
>
>
> I am stuck.
>
> THanks for the help...
>
>
> --chad
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]