Re: Hello list, script scheduling question.
Date: Fri, 25 May 2018 19:08:50 -0400
Message-ID: <3adb3c1a-751b-c338-f87a-488dc330a712_at_gmail.com>
Yes.
if [ -f /tmp/backup_running_$ORACLE_SID ];
then
echo "Backup crawling for $ORACLE_SID";
exit;
else
touch /tmp/backup_running_$ORACLE_SID;
fi;
Crontab emails the standard output of the script to the issuer, so you should be fine. BTW, this is a standard shell programming solution, nothing to do with Oracle. This is elementary, my dear Raman.
On 05/25/2018 05:46 PM, V Raman wrote:
> I am trying to set up a backup script to be called for various DBs in
> the DB server through crontab. If an instance of the script is running
> for the GIVEN oracle_sid I dont want another instance of the backup
> script to be started. However, if an instance of the script is running
> for a different oraclesid, I am ok with starting a new instance run of
> the script. Linux RHES7, bash.
>
> I tried using grep, grep -v $$, pgrep, etc inside the script and also
> tried pgrep in crontab, not lucky. Web searching has not led me
> anywhere so far. Any short and sweet solution for this issue?
-- Mladen Gogala Database Consultant Tel: (347) 321-1217 -- http://www.freelists.org/webpage/oracle-lReceived on Sat May 26 2018 - 01:08:50 CEST