Verify that a cron job has completed
grep scriptname /var/log/syslog
/var/log/cron
you can check to if its currently running with:
ps aux
To make sure a script completed successfully one should really use a temp file. Create it when the job starts and delete it when it finished. This also catches crashes and avoids running the same job again in case of errors.
#!/bin/bash
# check if there is already a temp file with suffix .myscript in /tmp,
# if file exists return with status of 666
[ -f /tmp/*.bla ] && exit 666
# create a temp file with suffix .myscript
TEMP_FILE=`mktemp --suffix .myscript`
touch $TEMP_FILE
#
# script stuff
#
# we are done, clean-up after ourselves
rm $TEMP_FILE