LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 10-21-2011, 07:29 AM   #1
arnabchowdhury83
LQ Newbie
 
Registered: Dec 2008
Posts: 2

Rep: Reputation: 0
Unhappy crontab


how to check time length of last running crontab job ?? plz help me plz plz
 
Old 10-21-2011, 07:49 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
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.

Last edited by macemoneta; 10-21-2011 at 07:51 AM.
 
Old 10-21-2011, 09:07 AM   #3
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] crontab help mwkemo Linux - Newbie 3 10-28-2009 02:11 PM
linux crontab vs unix crontab ytd Linux - General 2 08-09-2009 06:07 AM
replaced crontab, now should get crontab back to what it was raminn Linux - Newbie 2 10-20-2008 08:15 PM
man crontab(5) vs crontab(1) Canis Polaris Linux - Newbie 2 06-04-2008 05:03 PM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 01:35 PM


All times are GMT -5. The time now is 08:54 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration