wskibum has asked for the wisdom of the Perl Monks concerning the following question:
I have a need to move my log files around and I am using a simple perl scp script to do this. Now I need to add some error reporting to the script and I am in over my head.
1: I need to send an email when scp cannot connect to a server
2: I need to send and email if scp cannot find the file to download
How can I get the error codes on a failure and what do I do with it?
Please help me out if you can, I've been searching the web with no luck for 2 days.
currently my scp command looks something like this:
GET THE FILE WITH SCP # $filetoget="$LOGFILEDIR/$f\.@FILEDOMAIN\$i\.$year-$mon-$mday"; $command = "/usr/bin/scp $a:$filetoget $f\.@FILEDOMAIN\$i\.$year$mon$m +day\.$a";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: help with scp error codes
by ikegami (Patriarch) on Mar 16, 2008 at 08:18 UTC | |
by tachyon-II (Chaplain) on Mar 16, 2008 at 09:21 UTC | |
|
Re: help with scp error codes
by apl (Monsignor) on Mar 16, 2008 at 13:35 UTC |