Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a lot of crontask on my linux servers for our applications. But I don't find any way to know when a task end, and how long it run. Must I add a soft like time command to log this? Is there any way to configure cron to do this? I have for example a script in /etc/cron.daily which take too much time, but I can't figure which one!

Regards,
Cédric

share|improve this question
    
Which crond are you using? –  Ignacio Vazquez-Abrams Mar 18 '11 at 10:05
    
anacron on Debian servers –  Cédric Girard Mar 18 '11 at 14:23

1 Answer 1

up vote 3 down vote accepted

man cron

You should see something like

-L loglevel
               Sets the loglevel for cron. The standard logging level (1) will
               log  the start of all the cron jobs. A higher loglevel (2) will
               cause cron to log also the end of all cronjobs,  which  can  be
               useful  to  audit  the  behaviour of tasks run by cron. Logging
               will be disabled if the loglevel is set to zero (0).

To used the option you can check out /etc/default/cron

At least in Debian it has a comment like this:

# Extra options for cron, see cron(8)
# For example, set a higher log level to audit cron's work
# EXTRA_OPTS="-L 2"

After making changes to the config file you would need to restart Cron:

/etc/init.d/cron restart
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.