EvanstonEddie
asked on
Simultaneous Runs
I am sort of new to UNIX and don't know much of the commands, there I have this question to ask of you guys.
I have a unix script that is on a schedule to run every friday at 5pm, and to also run on last day of month at 5pm. There will be cases when the two criterias above are true, therefore causing the same job to run simultaneously. Are there any UNIX statements that would avoid this situation from occuring?
Thanks much for your help!
I have a unix script that is on a schedule to run every friday at 5pm, and to also run on last day of month at 5pm. There will be cases when the two criterias above are true, therefore causing the same job to run simultaneously. Are there any UNIX statements that would avoid this situation from occuring?
Thanks much for your help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
in bira's script you should change the first line for
a=`ps -ef |grep YOURSCRIPT|grep -v grep`
otherwise the script will never run.
a=`ps -ef |grep YOURSCRIPT|grep -v grep`
otherwise the script will never run.
Hey Santunes
I agree
Regards
I agree
Regards
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
a=`ps -ef |grep YOURSCRIPT`
if [ $? -eq 0 ] ; then
echo "this is running now"
exit
fi
So the script will never run if it find another instance
running.