how to prevent cron logs from registering in syslog?

5,606

You need to find the line that defines what should be sent to /var/log/syslog and modify it so that cron messages are not included. For example on an Ubuntu system I have to hand the /etc/rsyslog.d/50-default.conf file has the following entry for syslog:

*.*;auth,authpriv.none             -/var/log/syslog

changing it to:

*.*;cron,auth,authpriv.none             -/var/log/syslog

Does what you want. Note that the above is taking advantage of the ability to specify multiple facilities with the same priority as a list, if you don't already have a .none priority you would have to do this for example:

*.*;auth,authpriv.info;cron.none             -/var/log/syslog
Share:
5,606

Related videos on Youtube

shgnInc
Author by

shgnInc

Updated on September 18, 2022

Comments

  • shgnInc
    shgnInc over 1 year

    I have separated my crontab logging into /var/log/cron.log by uncommenting the below line in /etc/syslog.conf, but it still writes to /var/log/syslog too!

    cron.*                                  /var/log/cron.log
    

    How can i prevent it from writing to /var/log/syslog?

  • shgnInc
    shgnInc over 10 years
    Thank you. May I ask you to describe more the second part of your answer?
  • Freedo
    Freedo almost 3 years
    Doesn't seem to be working for me :( even with restarting rsyslog and cron