LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   List Jobs From Yesterday (https://www.linuxquestions.org/questions/linux-general-1/list-jobs-from-yesterday-879867/)

Norwood 05-10-2011 02:09 PM

List Jobs From Yesterday
 
Is it possible to list all jobs and their pids from a certain time frame? For instance if I needed to see all completed jobs from yesterday how would I do this?

I've tried jobs -n but that was messed up because I had typed jobs right before that.

kbp 05-10-2011 07:33 PM

No, if you want to track the jobs you'll need to configure a script wrapper to log the start/finish time as well as any output.

eg.

Code:

LOG=/var/log/myjobs.log
JOB=$1

echo "Start $JOB: $(date <pick-your-formatting>)" >> $LOG
$JOB >> $LOG 2>&1
echo "End $JOB: $(date <pick-your-formatting>)" >> $LOG

hth


All times are GMT -5. The time now is 09:46 AM.