FourierXForm has asked for the wisdom of the Perl Monks concerning the following question:
Here is my Perl code:$ /usr/bin/tar -cz /opt/back | /usr/bin/ssh myname@remote.host.com 'dd + of=/opt/rback/back.tar.gz'
When I execute this code snippet, all the output goes to STDOUT. How do I get this to work. Thanks!my $tar = "/usr/bin/tar"; my $taropts = "-cz"; my $backupdir = "/opt/back"; my $ssh = "/usr/bin/ssh"; my $user = "myname"; my $remotehost = "remote.host.com"; my $remotedir = "/opt/rback"; my @args = ($tar, "$taropts", "$backupdir", "\|", $ssh, "$user\@$remot +ehost", "'dd of=$remotedir/back.tar.gz'"); system(@args) == 0 or die "System @args failed: $!\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: system and pipes
by matija (Priest) on Jan 18, 2006 at 15:24 UTC | |
by FourierXForm (Acolyte) on Jan 18, 2006 at 15:32 UTC | |
|
Re: system and pipes
by glasswalk3r (Friar) on Jan 18, 2006 at 17:45 UTC | |
|
Re: system and pipes
by Anonymous Monk on Jan 18, 2006 at 19:55 UTC | |
|
Re: system and pipes
by svenXY (Deacon) on Jan 18, 2006 at 15:22 UTC | |
by FourierXForm (Acolyte) on Jan 18, 2006 at 15:26 UTC | |
|
Re: system and pipes
by bravenmd (Sexton) on Jan 19, 2006 at 15:40 UTC |