{"id":27,"date":"2015-01-26T16:33:26","date_gmt":"2015-01-26T15:33:26","guid":{"rendered":"http:\/\/www.contentecontent.com\/blog\/?p=27"},"modified":"2015-05-02T19:58:25","modified_gmt":"2015-05-02T18:58:25","slug":"stop-cron-from-cluttering-syslog","status":"publish","type":"post","link":"https:\/\/www.contentecontent.com\/blog\/2015\/01\/stop-cron-from-cluttering-syslog\/","title":{"rendered":"Stop cron from cluttering syslog"},"content":{"rendered":"<p>Every time a cron job is executed, an entry will be added to syslog, no matter whether the job succeeded or not. I have a couple of crons that run every minute, so syslog gets awfully cluttered with useless lines. Adding <code>&gt; \/dev\/null<\/code> or <code>&gt; \/dev\/null 2&gt;&amp;1<\/code> to the job commands doesn&#8217;t help.<\/p>\n<p><!--more--><\/p>\n<p>Fortunately cron logging can be configured, in <code>\/etc\/default\/cron<\/code>. Log levels are explained in that file:<\/p>\n<pre><code># Or, to log standard messages, plus jobs with exit status != 0:\n# EXTRA_OPTS='-L 5'\n#\n# For quick reference, the currently available log levels are:\n#   0   no logging (errors are logged regardless)\n#   1   log start of jobs\n#   2   log end of jobs\n#   4   log jobs with exit status != 0\n#   8   log the process identifier of child process (in all logs)\n#\n# EXTRA_OPTS=\"\"\n<\/code><\/pre>\n<p>The default is to log the start of every job. I uncommented the last line and set it to <code>EXTRA_OPTS=\"-L 0\"<\/code><\/p>\n<p>Then, restart the cron daemon:<\/p>\n<pre><code>\/etc\/init.d\/cron restart\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Every time a cron job is executed, an entry will be added to syslog, no matter whether the job succeeded or not. I have a couple of crons that run every minute, so syslog gets awfully cluttered with useless lines. Adding &gt; \/dev\/null or &gt; \/dev\/null 2&gt;&amp;1 to the job commands doesn&#8217;t help.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[8,2],"class_list":["post-27","post","type-post","status-publish","format-standard","hentry","category-server-admin","tag-cron","tag-debian"],"_links":{"self":[{"href":"https:\/\/www.contentecontent.com\/blog\/wp-json\/wp\/v2\/posts\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.contentecontent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.contentecontent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.contentecontent.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.contentecontent.com\/blog\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":3,"href":"https:\/\/www.contentecontent.com\/blog\/wp-json\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":57,"href":"https:\/\/www.contentecontent.com\/blog\/wp-json\/wp\/v2\/posts\/27\/revisions\/57"}],"wp:attachment":[{"href":"https:\/\/www.contentecontent.com\/blog\/wp-json\/wp\/v2\/media?parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.contentecontent.com\/blog\/wp-json\/wp\/v2\/categories?post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.contentecontent.com\/blog\/wp-json\/wp\/v2\/tags?post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}