cancel
Showing results for 
Search instead for 
Did you mean: 

can script ignore error 2?

Dave Chamberlin
Trusted Contributor

can script ignore error 2?

Greetings, I am running hpux 11.23. I have a pre-backup script that moves all zip files in one directory, to a new directory. Sometimes there are file additions during the move period that then get compressed, that appears to cause the script to complete with error 2. The intended files appear to be moved successfully. The error causes Data Protector terminate without saving anything to tape. I would like the script to ignore error 2. any ideas? Thanks
1 REPLY
Dennis Handly
Acclaimed Contributor

Re: can script ignore error 2?

Which script is getting error 2, yours?

You can either always exit with 0, or if the current status is 2, then reset it to 0.
status=$?
if [ $status -eq 2 ]; then
status=0;
fi
exit $status