To create a cron.log
file to log crontab
logs on an Ubuntu system, follow these steps:
crontab
configuration file for the root user:sudo crontab -eSource:www.lautturi.com
crontab
to the cron.log
file:SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root * * * * * /usr/bin/php /var/www/html/cron.php >> /var/log/cron.log 2>&1
This will log the output of the crontab
command to the cron.log
file in the /var/log
directory.
Save the file and exit.
To view the cron.log
file, use the tail
command:
tail /var/log/cron.log
This will display the last few lines of the cron.log
file.