{"id":304,"date":"2019-10-21T19:42:28","date_gmt":"2019-10-21T17:42:28","guid":{"rendered":"http:\/\/linuxboxen2.dk\/?p=304"},"modified":"2019-10-21T19:42:28","modified_gmt":"2019-10-21T17:42:28","slug":"org_crontab","status":"publish","type":"post","link":"https:\/\/www.linuxboxen.dk\/?p=304","title":{"rendered":"CRONTAB"},"content":{"rendered":"<p>CRONTAB(1)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 General Commands Manual\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CRONTAB(1)<\/p>\n<p>NAME<br \/>\ncrontab &#8211; maintain crontab files for individual users (Vixie Cron)<\/p>\n<p>SYNOPSIS<br \/>\ncrontab [ -u user ] file<br \/>\ncrontab [ -u user ] [ -i ] { -e | -l | -r }<\/p>\n<p>DESCRIPTION<br \/>\ncrontab\u00a0 is\u00a0 the\u00a0 program used to install, deinstall or list the tables<br \/>\nused to drive the cron(8) daemon in Vixie Cron.\u00a0\u00a0 Each\u00a0 user\u00a0 can\u00a0 have<br \/>\ntheir\u00a0\u00a0\u00a0 own\u00a0\u00a0\u00a0 crontab,\u00a0\u00a0\u00a0 and\u00a0\u00a0\u00a0 though\u00a0\u00a0\u00a0 these\u00a0\u00a0\u00a0 are\u00a0\u00a0\u00a0 files\u00a0\u00a0 in<br \/>\n\/var\/spool\/cron\/crontabs, they are not intended to be edited directly.<\/p>\n<p>If the \/etc\/cron.allow file exists, then you must be listed\u00a0 (one\u00a0 user<br \/>\nper\u00a0 line)\u00a0 therein in order to be allowed to use this command.\u00a0 If the<br \/>\n\/etc\/cron.allow file does not exist but the\u00a0 \/etc\/cron.deny\u00a0 file\u00a0 does<br \/>\nexist,\u00a0 then you must not be listed in the \/etc\/cron.deny file in order<br \/>\nto use this command.<\/p>\n<p>If neither of these files exists, then depending on site-dependent con\u2010<br \/>\nfiguration\u00a0 parameters, only the super user will be allowed to use this<br \/>\ncommand, or all users will be able to use this command.<\/p>\n<p>If both files exist then \/etc\/cron.allow takes precedence. Which\u00a0 means<br \/>\nthat\u00a0 \/etc\/cron.deny\u00a0 is not considered and your user must be listed in<br \/>\n\/etc\/cron.allow in order to be able to use the crontab.<\/p>\n<p>Regardless of the existance of any of these files, the root administra\u2010<br \/>\ntive\u00a0 user\u00a0 is\u00a0 always allowed to setup a crontab.\u00a0 For standard Debian<br \/>\nsystems, all users may use this command.<\/p>\n<p>If the -u option is given, it specifies the\u00a0 name\u00a0 of\u00a0 the\u00a0 user\u00a0 whose<br \/>\ncrontab\u00a0 is\u00a0 to\u00a0 be\u00a0 used (when listing) or modified (when editing). If<br \/>\nthis option is not given, crontab examines &#8220;your&#8221;\u00a0 crontab,\u00a0 i.e.,\u00a0 the<br \/>\ncrontab\u00a0 of the person executing the command.\u00a0 Note that su(8) can con\u2010<br \/>\nfuse crontab and that if you are running inside\u00a0 of\u00a0 su(8)\u00a0 you\u00a0 should<br \/>\nalways use the -u option for safety&#8217;s sake.<\/p>\n<p>The\u00a0 first\u00a0 form\u00a0 of this command is used to install a new crontab from<br \/>\nsome named file or standard\u00a0 input\u00a0 if\u00a0 the\u00a0 pseudo-filename\u00a0 &#8220;-&#8221;\u00a0 is<br \/>\ngiven.<\/p>\n<p>The\u00a0 -l\u00a0 option\u00a0 causes the current crontab to be displayed on standard<br \/>\noutput. See the note under DEBIAN SPECIFIC below.<\/p>\n<p>The -r option causes the current crontab to be removed.<\/p>\n<p>The -e option is used to edit the\u00a0 current\u00a0 crontab\u00a0 using\u00a0 the\u00a0 editor<br \/>\nspecified\u00a0 by\u00a0 the\u00a0 VISUAL\u00a0 or EDITOR environment variables.\u00a0 After you<br \/>\nexit from the editor, the modified crontab will be installed\u00a0 automati\u2010<br \/>\ncally.\u00a0 If\u00a0 neither\u00a0 of\u00a0 the environment variables is defined, then the<br \/>\ndefault editor \/usr\/bin\/editor is used.<\/p>\n<p>The -i option modifies the -r option to prompt the\u00a0 user\u00a0 for\u00a0 a\u00a0 &#8216;y\/Y&#8217;<br \/>\nresponse before actually removing the crontab.<\/p>\n<p>DEBIAN SPECIFIC<br \/>\nThe\u00a0 &#8220;out-of-the-box&#8221;\u00a0 behaviour for crontab -l is to display the three<br \/>\nline &#8220;DO NOT EDIT THIS FILE&#8221; header that is placed at the beginning\u00a0 of<br \/>\nthe\u00a0 crontab\u00a0 when\u00a0 it\u00a0 is\u00a0 installed. The problem is that it makes the<br \/>\nsequence<\/p>\n<p>crontab -l | crontab &#8211;<\/p>\n<p>non-idempotent &#8212; you keep adding copies of\u00a0 the\u00a0 header.\u00a0 This\u00a0 causes<br \/>\npain\u00a0 to scripts that use sed to edit a crontab. Therefore, the default<br \/>\nbehaviour of the -l option has been changed to not output such\u00a0 header.<br \/>\nYou\u00a0 may obtain the original behaviour by setting the environment vari\u2010<br \/>\nable CRONTAB_NOHEADER to &#8216;N&#8217;, which will cause the crontab\u00a0 -l\u00a0 command<br \/>\nto emit the extraneous header.<\/p>\n<p>SEE ALSO<br \/>\ncrontab(5), cron(8)<\/p>\n<p>FILES<br \/>\n\/etc\/cron.allow<br \/>\n\/etc\/cron.deny<br \/>\n\/var\/spool\/cron\/crontabs<\/p>\n<p>There\u00a0\u00a0\u00a0 is\u00a0\u00a0\u00a0 one\u00a0\u00a0 file\u00a0\u00a0 for\u00a0\u00a0 each\u00a0\u00a0 user&#8217;s\u00a0\u00a0 crontab\u00a0\u00a0 under\u00a0\u00a0 the<br \/>\n\/var\/spool\/cron\/crontabs directory. Users are not allowed to\u00a0 edit\u00a0 the<br \/>\nfiles\u00a0 under\u00a0 that directory directly to ensure that only users allowed<br \/>\nby the system to run periodic tasks can add them,\u00a0 and\u00a0 only\u00a0 syntacti\u2010<br \/>\ncally correct crontabs will be written there.\u00a0 This is enforced by hav\u2010<br \/>\ning the directory writable only by the crontab\u00a0 group\u00a0 and\u00a0 configuring<br \/>\ncrontab command with the setgid bid set for that specific group.<\/p>\n<p>STANDARDS<br \/>\nThe\u00a0 crontab command conforms to IEEE Std1003.2-1992 (&#8220;POSIX&#8221;).\u00a0 This<br \/>\nnew command syntax differs from previous versions\u00a0 of\u00a0 Vixie\u00a0 Cron,\u00a0 as<br \/>\nwell as from the classic SVR3 syntax.<\/p>\n<p>DIAGNOSTICS<br \/>\nA\u00a0 fairly\u00a0 informative\u00a0 usage\u00a0 message appears if you run it with a bad<br \/>\ncommand line.<\/p>\n<p>cron requires that each entry in a crontab end in a newline\u00a0 character.<br \/>\nIf\u00a0 the\u00a0 last entry in a crontab is missing the newline, cron will con\u2010<br \/>\nsider the crontab (at least partially) broken and refuse to install it.<\/p>\n<p>AUTHOR<br \/>\nPaul Vixie &lt;paul@vix.com&gt; is the author of cron and original creator of<br \/>\nthis\u00a0 manual page. This page has also been modified for Debian by Steve<br \/>\nGreenland, Javier Fernandez-Sanguino and Christian Kastner.<\/p>\n<p>4th Berkeley Distribution\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 19 April 2010\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CRONTAB(1)<br \/>\nManual page crontab(1) line 58\/108 (END) (press h for help or q to quit)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CRONTAB(1)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 General Commands Manual\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CRONTAB(1) NAME crontab &#8211; maintain crontab files for individual users (Vixie Cron) SYNOPSIS crontab [ -u user ] file crontab [ -u user ] [ -i ] { -e | -l | -r } DESCRIPTION crontab\u00a0 is\u00a0 the\u00a0 program used to install, deinstall or list the tables used to drive the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[8],"tags":[],"class_list":["post-304","post","type-post","status-publish","format-standard","hentry","category-shell"],"_links":{"self":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=304"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/304\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}