Completion time of a cron job ?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Completion time of a cron job ?
# 1  
Old 01-08-2010
Completion time of a cron job ?

how can we identify the task completion time which was initiated by CRON.

we have 1000 of jobs whihc are runing from cron so it is not feasable to edit every cron entry or every script to add the respective code to find teh completion time.

Can some one please provide a inut to find the task completion time ?

As we have 1000 of jobs so it is not easy to edit each script and enter teh code for start and end time in the script itself.
Also we cant enter the " | echo `date` > test " sort of thing as we are already redirecting the output of script to a file. Also we can't mannualy edit each cron entry :-(

any help is highly appriciated.
# 2  
Old 01-08-2010
If you can't do it in the cron jobs you'll have to do it in the cron daemon... What cron daemon are you using?
# 3  
Old 01-09-2010
If you cannot do manually, you can do the following, which will append date command to all the cron jobs.

Code:
crontab -l | sed '/^[^#]/s/$/;date/' | crontab -

And if you have the mailing system right, you would receive the mail after the completion of the job with the date and time.

Does it fits for you ?

Last edited by thegeek; 01-09-2010 at 09:04 AM..
# 4  
Old 01-12-2010
All the information is in the cron log though it is painful to process (particularly if your system re-uses PIDs in less than 24 hours).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

2. UNIX for Dummies Questions & Answers

Cron job executed at wrong time

Dear *nix users. I'm on Mac OS 10.6 / Terminal and try to use crontab to schedule two scripts every 30 minutes and every 41 minutes. I followed the man instructions and created / installed a crontab file for the current user:crontab -e with the following content */30 * * * *... (4 Replies)
Discussion started by: moxnos
4 Replies

3. UNIX for Dummies Questions & Answers

Setup a cron job and specified the start and end time

Hi guys, How can I specify the start and end time of a cron job. And my start time and end time are specified by minutes. For example, I want to set up a cron runs every 3 minutes from 18:40 to midnight. How can i do this please? Many thanks Best regards, Clu (4 Replies)
Discussion started by: clu
4 Replies

4. UNIX for Dummies Questions & Answers

How to findsuccessful job status completion in Autosys, programatically

We are using autosys for job scheduling. How to find successful job status completion in Autosys, programatically. Based on the successful job completion , mail has to be trigeered to Business users. Please help Thanks (0 Replies)
Discussion started by: vkalya
0 Replies

5. UNIX for Dummies Questions & Answers

cron job not running to completion

am running a cron job to do a backup of all user files. the script runs properly in the terminal but only backups about 20% of the files when run by cron. the Linux system is running BASH as far as I can tell. the symbols $FILE and $DIRECTORY are defined properly and the following is the... (1 Reply)
Discussion started by: novice633
1 Replies

6. Shell Programming and Scripting

Calculating completion time

The date construct in UNIX can be used to calculate when something is finished: date -v+1H displays the time 1 hour from now. I want to use the same construct in a script, but it is leading to error messages: echo "Finished at: " `date -v+$durationH` where $duration is calculated based on input... (3 Replies)
Discussion started by: figaro
3 Replies

7. UNIX for Dummies Questions & Answers

Average completion time calculation?

I've been trying all night to come up with a script that will take a file that contains job completion times like this as input: 18:30 17:45 16:39 18:01 17:50 ... and figure the Average completion time. I've tried several things, and I just can't seem to get it to figure correctly. I'm... (5 Replies)
Discussion started by: Seawall
5 Replies

8. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

9. UNIX for Dummies Questions & Answers

Job Completion Information?

Hi, I am trying to get some information on the jobs that are running. I have used the "ps" command, to get information such as 'cpu usage', 'username', 'pid', etc., I've also used the "bjobs" command to get information such as 'submit time' and 'start time'. The only thing I need now is to... (3 Replies)
Discussion started by: davidfrank
3 Replies

10. UNIX for Dummies Questions & Answers

Cron Sends mail to root on completion of job.

All I am running a few scripts through a cron job. This is for checking some key services that are running on by box. The problem is, everytime the cron runs, it sends a mail to the root account. The root account mails need to cleared every now and then. Is there some way I can stop these... (1 Reply)
Discussion started by: skotapal
1 Replies
Login or Register to Ask a Question