I’m preparing a Unix shell script to scan backup log and to check for failure code.
If the directory backup is finished with failure, then the script must be able to pick-up the failed directory and write to an include file for re-submit later.
The backup log should have showing following result:
Backup processing of '/fscm/ldata/91/*' finished without failure.
Backup processing of '/fscm/ldata/92/*' finished without failure.
Backup processing of '/fscm/ldata/93/*' finished without failure.
Backup processing of '/fscm/ldata/94/*' finished without failure.
Backup processing of '/fscm/ldata/95/*' finished without failure.
What if some directories were failed to backup?
Backup processing of '/fscm/ldata/97/*' finished with failure.
Backup processing of '/fscm/ldata/98/*' finished with failure.
I need to extract the directory name and insert double quote before and after the directory name to prepare the include file.
The command is (type in single line)
The code will return result as
This script was written and tested on AIX 5.1 and ksh Shell. You should be able to execute in any Unix and shell environment.
You’re welcome to comment.