![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to detect failure from batch SFTP and SHELL operations | chengwei | Shell Programming and Scripting | 2 | 05-28-2008 04:32 AM |
| strange net::SFTP Perl module debug entry | csgonan | Shell Programming and Scripting | 2 | 10-11-2007 03:04 PM |
| ssh/sftp failure connection | james_falco | UNIX for Advanced & Expert Users | 3 | 03-27-2007 08:19 AM |
| sftp shell that will validate files | biglarrrr | Shell Programming and Scripting | 0 | 09-22-2006 04:42 PM |
| validate | ruffenator | Shell Programming and Scripting | 3 | 01-22-2002 07:37 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Validate Failure of SFTP in PERL
Hi All,
I have the following statement in my perl script. sftp::get("ABC","DEF","abcdef","out","/tmp/config/data.xls") Whenever this statement fails due to username/password problem, it justs exit the script. I want to know how can i write my code separately for handling sucess and failure as this function does not return anything. If you can provide multiple solutions i would be grateful. Thanks, Rahul. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Try this (untested):
Code:
eval {
$sftp->get("ABC","DEF","abcdef","out","/tmp/config/data.xls");
}
if ($@) {
# error occurred
print STDERR "Error returned: $@\n";
} else {
print STDERR "Successfully retrieved\n";
}
|
|
#3
|
|||
|
|||
|
Does not Work
|
|
#4
|
|||
|
|||
|
SFTP from Unix
How to get the return value in Unix for SFTP? Success or failure...
How can we know that we have logged into another IP address or user account? How can we know that we have pulled or pushed a file successfully from here to there? Is there any return codes to indicate this? |
|
#5
|
||||
|
||||
|
Redirect the output to a log file and in log files grep for something like 100% Complete or Error etc.
rishi |
|
#6
|
|||
|
|||
|
Quote:
|
|||
| Google The UNIX and Linux Forums |