Of course, all the child scripts must know how to exit not zero on any sort of error, a recursive search for unexpected exits and unchecked conditions.
I tried with the pre-script error processing, with "sed -e". Looks like its working fine, but for what ever case (0 ,2, 4), it should send the e-mail to the user, stating the result.
But as per the script, its not sending e-mail for any failure, but the user is receiving the e-mail for any success.
Can you please look at the sub-script attached to this e-mail and let me know as to where i am going wrong.
Now i am facing a new issue.
When i execute the shell script, it just shows me blank with no progress.
-bash-3.00$ ./sqlldrclaims_backup_new.sh
Password:
SQL*Loader: Release 11.2.0.1.0 - Production on Tue Jan 18 10:26:39 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
-e Execute the ERR trap, if set, and exit if a command has a
nonzero exit status, and is not part of the compound list
following a if, until, or while keyword, and is not part of
an AND or OR list, and is not a pipeline preceded by the !
reserved word. This mode is disabled while reading
profiles.
Good idea to put a line in after saving $rc to display the value. This will tell you if the line is ever executed when the preceding command returns a non-zero exist status.
You can set -ex and get a progress report as child processes are started. However, if there is information to catch in the return code, you need to capture $? in another variable, IMMMEDIATELY, before it is overwritten by your error handling code.
But that is your choice, in terms of error handling architecture. The child script could log everything and just return 0 or 1, so when testing a child, you do not need the parent or a hand coded echo $? to see the result (and you might overlook that in a quick test). Logging should be clear, so it is good to have the parent log just say 'parent started at this time, started child at this time with these arguments, child can write log location, child ended good or bad at this time, parent ended at this time. This way, clutter can be logged down at the leaf level, and in some case rejects or errors are potentially large enough to go in a specific separate file, not the main log, but with the side log path and its stats in the main log. If you reuse the same log path, there should be internal start/end headers and code to prevent two runs at once.
You, too, deserve good error checking, handling, logging. Think of it as a real product, just like processed data. When x runs, it owes me an output file and a log of happy ending or a log of why not, all the time, 100%, unity, 1.0 probability!
Last edited by DGPickett; 01-18-2011 at 12:47 PM..
Hi Experts,
I am very much new to linux scripting, I am currently working on reducing my manual work and hence writing a script to automate few task.
I am running below command to snmpwalk the router..
snmpwalk -v 3 -u WANDL_SU -a MD5 -A vfipmpls -x DES -X VfIpMpLs -l authPriv... (19 Replies)
I have executed a command which has ports that have to be assigned.
then I deleted the files. Now I need to reinstall the command. but it says the ports are not free
How to terminate the port connections and reinstall in solaris unix
---------- Post updated at 09:07 PM ----------... (7 Replies)
Hi
I'm trying to do an upgrade for one application and whenever I run the upgradre the program shows the error that mcrypt module is not initially loaded with php.
My server is running xampp 0.9 and I know this library of mcrypt is already installed.
I changed the php.ini file in order to... (0 Replies)
OS : Solaris X86
gcc version 3.4.6
when i run my application, C with Motif application crashed and formed core. I collected the truss ouput.
Incurred fault #6, FLTBOUNDS %pc = 0xFE8B35CD
siginfo: SIGSEGV SEGV_MAPERR addr=0x00000275
Received signal #11, SIGSEGV
siginfo:... (2 Replies)
We have a system user "oracle_usr" always run some process in the system , but sometimes , these processes will not stop automatically until we terminate the process , can suggest the method how to terminate the process that is run by "oracle_usr" and run over 10 minutes ? thx (5 Replies)
I want to have a script to terminate the system process that generated by user oracle_usr and have already processed for over 10 minutes , could suggest the script ? thx (1 Reply)
In my system , there are a system user "cronusr" , it is mainly to run the crontab job in the database .Sometimes the cronjob process will be failure ( due to some reason ) so that many cronusr process are in the system , it affect other process in the system ,
I want to have a script that can... (2 Replies)
Hai all..
How do i terminate my telnet session automatically when my java applicatiion exits. i have a file run which executes my java application and takes care of all class and library path settings prior to the execution. I would like to terminate my session when my application exits. The... (4 Replies)