in reply to Probelm getting a large compressed tar file over ssh.
You have an error in your script - the command you're sending to the remote machine is not interpolated. You likely want:
$cmd="tar -czf - $rmt_dir";
Depending on how dire your error handling situation is, avoiding Perl might be the most convenient way to resolve your memory issues:
#!/usr/bin/sh ssh -c "tar -czf - $rmt_dir" >backup.tar.gz
This will run the tar command remotely and output the created .tar.gz file directly to STDOUT, and on the local end will write the output directly into a file instead of buffering it locally in memory. You will need some error checking afterwards though.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Probelm getting a large compressed tar file over ssh.
by swares (Monk) on Nov 30, 2005 at 09:09 UTC | |
by Corion (Patriarch) on Nov 30, 2005 at 09:25 UTC | |
by 0xbeef (Hermit) on Nov 30, 2005 at 12:21 UTC | |
Re^2: Probelm getting a large compressed tar file over ssh.
by science_gone_bad (Beadle) on Nov 30, 2005 at 19:40 UTC |
In Section
Seekers of Perl Wisdom