{"id":270,"date":"2015-12-31T12:51:59","date_gmt":"2015-12-31T10:51:59","guid":{"rendered":"http:\/\/catyellow.net\/blog\/?p=270"},"modified":"2018-06-02T22:41:03","modified_gmt":"2018-06-02T20:41:03","slug":"simulate-cron-environment","status":"publish","type":"post","link":"https:\/\/catyellow.net\/blog\/?p=270","title":{"rendered":"Simulate cron environment"},"content":{"rendered":"<p>Sometimes scripts aren&#8217;t working in cron, but they&#8217;re working manually. To debug them it&#8217;s helpful to simulate their running under cron environment.<\/p>\n<p>add this to cron and let it to run at least once<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n* * * * * env &amp;gt; ~\/cron_env\r\n<\/pre>\n<p>run this command to simulate environment:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nenv - `cat ~\/cron_env` \/bin\/sh\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes scripts aren&#8217;t working in cron, but they&#8217;re working manually. To debug them it&#8217;s helpful to simulate their running under cron environment. add this to cron and let it to run at least once run this command to simulate environment:<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[53],"_links":{"self":[{"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/270"}],"collection":[{"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=270"}],"version-history":[{"count":4,"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/270\/revisions"}],"predecessor-version":[{"id":336,"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/270\/revisions\/336"}],"wp:attachment":[{"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}