LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 06: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, 06: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: 344Reputation: 344Reputation: 344Reputation: 344
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 06:51 AM.
 
Old 10-21-2011, 08: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



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 01:11 PM
linux crontab vs unix crontab ytd Linux - General 2 08-09-2009 05:07 AM
replaced crontab, now should get crontab back to what it was raminn Linux - Newbie 2 10-20-2008 07:15 PM
man crontab(5) vs crontab(1) Canis Polaris Linux - Newbie 2 06-04-2008 04:03 PM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:26 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration