{"id":21249,"date":"2016-05-07T03:01:43","date_gmt":"2016-05-06T17:01:43","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=21249"},"modified":"2016-05-07T08:46:26","modified_gmt":"2016-05-06T22:46:26","slug":"crontab-web-server-housekeeping-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/crontab-web-server-housekeeping-primer-tutorial\/","title":{"rendered":"Crontab Web Server Housekeeping Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Linux\/housekeeping.jpg\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Crontab Web Server Housekeeping Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/housekeeping.jpg\" title=\"Crontab Web Server Housekeeping Primer Tutorial\" \/><\/a><p class=\"wp-caption-text\">Crontab Web Server Housekeeping Primer Tutorial<\/p><\/div>\n<p>We really love to use batch processes and Linux or Unix <a target=_blank title='Linux or Unix crontab information from computerhope ... thanks' href='http:\/\/www.computerhope.com\/unix\/ucrontab.htm'><i>crontab<\/i><\/a> methods to do things.  Guess maybe a lot of people of a certain age &#8230; cough, cough &#8230; feel quite comfortable around the bigger computer items like web servers, with their background processing potential, and can relate to processes working behind the scenes.  Of course this &#8220;behind the scenes&#8221; stuff is going on even more for modern personalized computer devices, and the world has never been more connected, and &#8220;feed&#8221;y &#8230; and all feeds back somewhere are probably using a backgrounding process on some server, somewhere.<\/p>\n<p>We can also purloin Linux or Unix <i>crontab<\/i> into doing quite glamorous things that affect front-end web and mobile and desktop application looks, and, of course we can harness it into doing the less glamorous (but no less important) tasks that web servers need to do too, for instance &#8230;<\/p>\n<ul>\n<li>not have runaway processes eating up CPU<\/li>\n<li>not eat up too much disk space<\/li>\n<li>in the case of Linux and Unix, not overspill any inode (number of files) quotas for the disks<\/li>\n<\/ul>\n<p>Respectively we find this most relates to &#8230;<\/p>\n<ul>\n<li>MySql long running SQL<\/li>\n<li>logs<\/li>\n<li>PHP web application &#8220;file leaves&#8221;<\/li>\n<\/ul>\n<p>And so we have our <i>crontab<\/i> at the rjmprogramming.com.au website doing a lot of tasks that (as also used in today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Linux\/housekeeping.jpg\" title='Click picture'>tutorial picture<\/a> (featuring the use of a <a target=_blank title='Gimp' href='http:\/\/www.gimp.org'>Gimp<\/a> Gaussian Blur filter)) &#8230;<\/p>\n<blockquote><p>\nThese are all the &#8220;housekeeping&#8221;<br \/>\ntasks involving periodic clearing<br \/>\nof files to ensure our inode limits<br \/>\nare not exceeded &#8230; monitored by &#8230;<br \/>\n<b><\/b><br \/>\ndf -i \/<br \/>\n<b><\/b><br \/>\n&#8230; nor our disk space is exceeded &#8230;<br \/>\n&#8230; monitored by &#8230;<br \/>\n<b><\/b><br \/>\ndf -k \/<br \/>\n<b><\/b><br \/>\nThey all take the form &#8230;<br \/>\n<b><\/b><br \/>\nminute    hour         dayMonth month dayWeek       command<br \/>\nspecified specified    *        *     *             ksh -c &#8220;rm -f [fileSpecificationWithWildcards]&#8221;<br \/>\n<b><\/b><br \/>\n&#8230; of cleaning up certain files once a day (for each category of file specification)\n<\/p><\/blockquote>\n<p> &#8230; &#8220;housekeep&#8221; the web server on behalf of its root disk called &#8220;\/&#8221; (how imaginative Linux\/Unix is?!).  But seriously, it also has a uuid nickname that is very long and non-memorable.  At least in Windows you have a <a target=_blank title='Windows command line label command information from computerhope ... thanks' href='http:\/\/www.computerhope.com\/issues\/ch000532.htm'><i>label<\/i><\/a> command that can give a &#8220;nickname&#8221; to your hardworking (web) server hard disk.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d21249' onclick='var dv=document.getElementById(\"d21249\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/crontab\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d21249' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We really love to use batch processes and Linux or Unix crontab methods to do things. Guess maybe a lot of people of a certain age &#8230; cough, cough &#8230; feel quite comfortable around the bigger computer items like web &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/crontab-web-server-housekeeping-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,29,37],"tags":[195,274,491,1854,707,1855,1319,1339,1411],"class_list":["post-21249","post","type-post","status-publish","format-standard","hentry","category-elearning","category-operating-system","category-tutorials","tag-centos","tag-crontab","tag-gimp","tag-housekeeping","tag-linux","tag-task","tag-tutorial","tag-unix","tag-web-server"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/21249"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=21249"}],"version-history":[{"count":7,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/21249\/revisions"}],"predecessor-version":[{"id":21771,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/21249\/revisions\/21771"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=21249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=21249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=21249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}