Page 1 of 1

Abort Job if Shell script fails

Posted: Tue Jul 17, 2007 11:05 am
by satishmelinamani
Hi All,

My requirement is to FTP few files with Current Date in file name (e.g.: File_Name_17_07_2007.sf). To achieve this I am calling a Shell Script in After Job Subroutine to FTP the file. But the problem is if by any reason ftp script fails my job has to abort, but this is not happening at this moment.

Please help me to force abort the job when shell script fails.


Thanks,
Satish

Posted: Tue Jul 17, 2007 11:29 am
by thebird
Why not use the ExecSh built-in routine in the Routine activity from the sequence? This way you would be able check if the script executed successfully or not, based on which you can abort the job as well as the sequence.

Posted: Tue Jul 17, 2007 12:55 pm
by chulett
Pass back a non-zero return status from your script if anything goes wrong in it. The job will notice.