LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   crontab (https://www.linuxquestions.org/questions/linux-general-1/crontab-909324/)

arnabchowdhury83 10-21-2011 06:29 AM

crontab
 
how to check time length of last running crontab job ?? plz help me plz plz :redface:

macemoneta 10-21-2011 06:49 AM

This will tell you the start time of the last run cron job:
Code:

tail -n1 /var/log/cron
If the job is still running, you can get the run time from 'ps' on the process id from the above.

16pide 10-21-2011 08:07 AM

I would suggest using a bash script such as this:
Code:

#!/bin/bash
echo starting cron>/var/tmp/cron-execution.txt
date >>/var/tmp/cron-execution.txt
# insert your true cron here
echo stopping cron>>/var/tmp/cron-execution.txt
date >>/var/tmp/cron-execution.txt



All times are GMT -5. The time now is 06:47 PM.