#! /bin/csh set oasis=/oasis set lockfile=$oasis/bin/download.lock set record_file=$oasis/raw/oasis.rcd set nonomatch #set FAILMAIL = "rich@mbari.org,jared@mbari.org,dfrench@mbari.org,kemi@mbari.org" set FAILMAIL = "rich@mbari.org" set MAIL = "/bin/mailx -s " set MAIL_SUBJECT = "TEST....Possible OASIS Download Lockfile Error" set MAIL_SUBJECT2 = "TEST... No download Lockfile Error" if ( -e $lockfile ) then echo Process already running: Exiting $MAIL "$MAIL_SUBJECT" $FAILMAIL << ! /oasis/bin/download has aborted without attempting a download. This is because it detected a pre-existing download.lock file in the /oasis/bin directory. Some possible causes for this are: 1) another instance of the download script is running normally. 2) another instance of the download script is hung. 3) a previous instance of the download script bombed and did not finish and thus did not delete the download.lock file. ! exit else echo OK to run $MAIL "$MAIL_SUBJECT2" $FAILMAIL << ! /oasis/bin/testdownloadlock finds its ok to run ! endif #echo Creating lock file... touch $lockfile echo Would Down M1 now echo Would Download M46044 now echo Deleting lock file... rm -rf $lockfile echo Normal Exit exit