what time did my process die ??

Hi there

I have a backup script that runs every night and for some reason ive been getting in in the morning and the process has died, Is there any way I can tell when it died? if not .....would anybody recommend some scripting that i could do that would be able to tell me this information

Cheers

the only way that i know of to know when a process disappears is to actually check for the process periodically ...

write a script that loops every minute (or second or hour) and looks for the backup process through a ps check ... if found, sleep and recheck again later ... if not found, send an email or log the error somewhere ...

good luck!

Another way is to run process from a programm (that will be a parent) and wait when the process is finished (use fork/exec/waitpid functions).

I do not know whether waitpid() can be used by process that is not a parent for process with given pid.

Does the backup process write to a log? If so look at the timestamp (with "ls -l /var/backup/log" or whatever) on the log to see when it was last updated. Even with no log, a backup process must write somewhere. By looking at the timestamps maybe you can figure it out.

A script?

#! /usr/bin/ksh
/path/to/backup.process
echo backup.process finished at $(date) > /tmp/backup_end.time
exit 0