Location of Cron Logs on Ubuntu 14.04

Cron logs on Ubuntu 14.04 are typically stored in the /var/log/syslog file. However, if you wish to separate cron-related logs into their own file, you can follow the steps you’ve provided to create a dedicated log file for cron messages. Here’s how you can do it:

  1. Open the 50-default.conf file in the /etc/rsyslog.d/ directory:

    1
    2
    
    cd /etc/rsyslog.d/
    sudo nano 50-default.conf
  2. Uncomment the line that corresponds to cron messages. Remove the “#” symbol at the beginning of the line:

    1
    
    #cron.* /var/log/cron.log
  3. Save the file and exit the text editor.

  4. Restart the rsyslog service to apply the changes:

    1
    
    sudo service rsyslog restart
  5. Restart the cron daemon to ensure it starts writing messages to the new log file:

    1
    
    sudo service cron restart

After following these steps, your cron-related logs will be redirected to the /var/log/cron.log file instead of being mixed with other system logs in /var/log/syslog. This separation can make it easier to monitor and manage cron-related events.

Please note that these instructions are specific to Ubuntu 14.04. If you are using a newer version of Ubuntu, the steps might differ slightly.

0%