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 :frowning:

any help is highly appriciated.

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?

If you cannot do manually, you can do the following, which will append date command to all the cron jobs.

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 ?

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).