I want to know how I can see exactly what the cron jobs are doing on each execution. Where are the log files located? Or can I send the output to my email? I have set the email address to send the log when the cron job runs but I haven't received anything yet.
相关问题
- I want to trace logs using a Macro multi parameter
- Error message 'No handlers could be found for
- convert logback.xml to log4j.properties
- Django management command doesn't show logging
- apache modules ap_log_perror is at a different lev
相关文章
- how do I log requests and responses for debugging
- Android Studio doesn't display logs by package
- Stacktrace does not print in Glassfish 4.1 Cluster
- Out of curiosity — why don't logging APIs impl
- Laravel log file based on date
- Java -How to get logger to work in shutdown hook?
- Codeigniter not logging
- Is there any way to remove the information line fr
On Ubuntu you can enable a
cron.log
file to contain just the CRON entries.Uncomment the line that mentions
cron
in/etc/rsyslog.d/50-default.conf
file:Save and close the file and then restart the
rsyslog
service:You can now see cron log entries in its own file:
Sample outputs:
However, you will not see more information about what scripts were actually run inside
/etc/cron.daily
or/etc/cron.hourly
, unless those scripts direct output to the cron.log (or perhaps to some other log file).If you want to verify if a crontab is running and not have to search for it in
cron.log
orsyslog
, create a crontab that redirects output to a log file of your choice - something like:Steps taken from: https://www.cyberciti.biz/faq/howto-create-cron-log-file-to-log-crontab-logs-in-ubuntu-linux/