Crontab : is there any log with begin and end time?
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
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