{"id":2594,"date":"2019-07-23T03:05:41","date_gmt":"2019-07-23T10:05:41","guid":{"rendered":"https:\/\/www.cloudinsidr.com\/content\/?p=2594"},"modified":"2019-07-23T03:06:55","modified_gmt":"2019-07-23T10:06:55","slug":"its-never-too-late-cron-101","status":"publish","type":"post","link":"https:\/\/www.cloudinsidr.com\/content\/its-never-too-late-cron-101\/","title":{"rendered":"It&#8217;s never too late: cron 101"},"content":{"rendered":"<p>Good ol&#8217; fashioned cron can greatly simplify system maintenance.<\/p>\n<p><!--more--><\/p>\n<p>A note on system logs: in Linux distributions of the IBM Red Hat family, including Fedora and CentOS, system logs end up NOT in<\/p>\n<pre>\/etc\/syslog.conf<\/pre>\n<p>but in:<\/p>\n<pre>\/etc\/rsyslog.conf<\/pre>\n<p>instead.<\/p>\n<h2>Install cron<\/h2>\n<p>Install cron using:<\/p>\n<pre>yum -y install vixie-cron crontabs<\/pre>\n<p>Make sure the daemon will be switched on after reboot:<\/p>\n<pre>\/sbin\/chkconfig crond on<\/pre>\n<p>Start the cron daemon:<\/p>\n<pre>\/sbin\/service crond start<\/pre>\n<h2>Edit cron jobs<\/h2>\n<p>To edit crontab, the command<\/p>\n<pre>crontab -e<\/pre>\n<p>should suffice. If not, you may want to try editing the file directly:<\/p>\n<pre>nano \/etc\/crontab<\/pre>\n<h2>Set a default editor for crontab<\/h2>\n<p>Set a default editor for your cron jobs:<\/p>\n<pre>export EDITOR=\/usr\/bin\/nano<\/pre>\n<h2>Run cron jobs manually<\/h2>\n<p>You can try running select cronjobs right away:<\/p>\n<pre>run-parts \/etc\/cron.monthly<\/pre>\n<pre><\/pre>\n<p>Should that fail, set your cron job in question for a couple of minutes from the current date and time and see if you can catch any errors this way.<\/p>\n<p>Verify the resulting output in the logs:<\/p>\n<pre>tail \/var\/log\/cron\r\n\r\ntail \/var\/log\/messages<\/pre>\n<p>If not sure about your instance&#8217;s time and date, enter:<\/p>\n<pre>date<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Good ol&#8217; fashioned cron can greatly simplify system maintenance.<\/p>\n","protected":false},"author":1,"featured_media":76,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[16,143,213],"tags":[255,254],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v14.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>It&#039;s never too late: cron 101 - CloudInsidr<\/title>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cloudinsidr.com\/content\/its-never-too-late-cron-101\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"It&#039;s never too late: cron 101 - CloudInsidr\" \/>\n<meta property=\"og:description\" content=\"Good ol&#8217; fashioned cron can greatly simplify system maintenance.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cloudinsidr.com\/content\/its-never-too-late-cron-101\/\" \/>\n<meta property=\"og:site_name\" content=\"CloudInsidr\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-23T10:05:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-23T10:06:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.cloudinsidr.com\/content\/wp-content\/uploads\/2015\/11\/cloudinsidr_logo_900px-wide.png\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"326\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/#website\",\"url\":\"https:\/\/www.cloudinsidr.com\/content\/\",\"name\":\"CloudInsidr\",\"description\":\"Cyber security, infotech\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.cloudinsidr.com\/content\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/its-never-too-late-cron-101\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.cloudinsidr.com\/content\/wp-content\/uploads\/2015\/11\/cloudinsidr_logo_900px-wide.png\",\"width\":900,\"height\":326,\"caption\":\"cloudinsidr.com logo (900px wide)\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/its-never-too-late-cron-101\/#webpage\",\"url\":\"https:\/\/www.cloudinsidr.com\/content\/its-never-too-late-cron-101\/\",\"name\":\"It's never too late: cron 101 - CloudInsidr\",\"isPartOf\":{\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/its-never-too-late-cron-101\/#primaryimage\"},\"datePublished\":\"2019-07-23T10:05:41+00:00\",\"dateModified\":\"2019-07-23T10:06:55+00:00\",\"author\":{\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/#\/schema\/person\/dd6ee9cb21cf05763fd7cff3d6f11b2b\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.cloudinsidr.com\/content\/its-never-too-late-cron-101\/\"]}]},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/#\/schema\/person\/dd6ee9cb21cf05763fd7cff3d6f11b2b\",\"name\":\"Cloud Insidr\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8b2fa1415b3d573b97d818b8f8f83b7c?s=96&d=mm&r=g\",\"caption\":\"Cloud Insidr\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/posts\/2594"}],"collection":[{"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/comments?post=2594"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/posts\/2594\/revisions"}],"predecessor-version":[{"id":2595,"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/posts\/2594\/revisions\/2595"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/media\/76"}],"wp:attachment":[{"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/media?parent=2594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/categories?post=2594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/tags?post=2594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}