{"id":2909,"date":"2018-08-08T06:11:27","date_gmt":"2018-08-08T06:11:27","guid":{"rendered":"https:\/\/tst-amo.net.ua\/blog\/?p=2909"},"modified":"2018-08-08T06:11:27","modified_gmt":"2018-08-08T06:11:27","slug":"cron-%d0%be%d1%82%d0%ba%d0%bb%d1%8e%d1%87%d0%b8%d1%82%d1%8c-%d1%83%d0%b2%d0%b5%d0%b4%d0%be%d0%bc%d0%bb%d0%b5%d0%bd%d0%b8%d1%8f-%d0%bd%d0%b0-%d0%bf%d0%be%d1%87%d1%82%d1%83","status":"publish","type":"post","link":"https:\/\/tst-amo.net.ua\/blog\/?p=2909","title":{"rendered":"Cron &#8211; \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u043e\u0447\u0442\u0443"},"content":{"rendered":"<h3>Cron job prevent the sending of errors and output<\/h3>\n<p>To prevent the sending of errors and output, add any one of the following at the end of the line for each cron job to redirect output to \/dev\/null.<\/p>\n<pre>&gt;\/dev\/null 2&gt;&amp;1<\/pre>\n<p>OR<\/p>\n<pre>&gt; \/dev\/null<\/pre>\n<p>OR<\/p>\n<pre>&gt; \/dev\/null 2&gt;&amp;1 || true<\/pre>\n<h3>Cron job example<\/h3>\n<p>Edit\/Open your cron jobs, enter:<\/p>\n<pre>$ crontab -e<\/pre>\n<p>Append string &gt;\/dev\/null 2&gt;&amp;1 to stop mail alert:<\/p>\n<pre>0 1 5 10 * \/path\/to\/script.sh &gt;\/dev\/null 2&gt;&amp;1<\/pre>\n<p>OR<\/p>\n<pre>0 1 5 10 * \/path\/to\/script.sh &gt; \/dev\/null<\/pre>\n<p>OR<\/p>\n<pre>0 * * * * \/path\/to\/command arg1 &gt; \/dev\/null 2&gt;&amp;1 || true<\/pre>\n<p>Save and close the file.<\/p>\n<h3>Set MAILTO variable<\/h3>\n<p>You can set MAILTO=\u201d\u201d variable at the start of your crontab file. This will also disable email alert. Edit\/Open your cron jobs:<\/p>\n<pre>$ crontab -e<\/pre>\n<p>At the top of the file, enter:<\/p>\n<pre>MAILTO=\"\"<\/pre>\n<p>Save and close the file.<\/p>\n<p><a href=\"https:\/\/www.cyberciti.biz\/faq\/disable-the-mail-alert-by-crontab-command\/\">https:\/\/www.cyberciti.biz\/faq\/disable-the-mail-alert-by-crontab-command\/<\/a><\/p>\n<div class=\"pdfprnt-buttons pdfprnt-buttons-post pdfprnt-bottom-right\"><a href=\"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=wpv2posts2909&print=pdf\" class=\"pdfprnt-button pdfprnt-button-pdf\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/tst-amo.net.ua\/blog\/wp-content\/plugins\/pdf-print\/images\/pdf.png\" alt=\"image_pdf\" title=\"View PDF\" \/><\/a><a href=\"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=wpv2posts2909&print=print\" class=\"pdfprnt-button pdfprnt-button-print\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/tst-amo.net.ua\/blog\/wp-content\/plugins\/pdf-print\/images\/print.png\" alt=\"image_print\" title=\"Print Content\" \/><\/a><\/div>","protected":false},"excerpt":{"rendered":"<p>Cron job prevent the sending of errors and output To prevent the sending of errors and output, add any one of the following at the end of the line for each cron job to redirect output to \/dev\/null. &gt;\/dev\/null 2&gt;&amp;1 OR &gt; \/dev\/null OR &gt; \/dev\/null 2&gt;&amp;1 || true Cron job example Edit\/Open your cron &#8230;<\/p>\n<p><a href=\"https:\/\/tst-amo.net.ua\/blog\/?p=2909\" class=\"more-link\">Continue reading &lsquo;Cron &#8211; \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u043e\u0447\u0442\u0443&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[142,50,47],"tags":[],"class_list":["post-2909","post","type-post","status-publish","format-standard","hentry","category-cron","category-freebsd","category-linux"],"_links":{"self":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2909"}],"collection":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2909"}],"version-history":[{"count":1,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2909\/revisions"}],"predecessor-version":[{"id":2910,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2909\/revisions\/2910"}],"wp:attachment":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}