What is `-p` used for `cron`?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












In cron's manpage (cronie)



-p Allows Cron to accept any user set crontables.


I learned that cron daemon will implicitly search for and run the cron jobs defined in /etc/crontab, /etc/cron.d/* and /var/spool/cron/cronstabs/*.



What is -p used for?



Is it to explicitly tell cron to search for and run the cron jobs defined in a crontab file which is stored in some place other than those mentioned above?



Or is it to copy a crontab file stored in some place other than those mentioned above to one of the places mentioned above?



Does the cron on Debian or its derivatives have -p option? I don't find -p on the manpage of cron on Ubuntu.



Thanks.










share|improve this question



























    up vote
    2
    down vote

    favorite












    In cron's manpage (cronie)



    -p Allows Cron to accept any user set crontables.


    I learned that cron daemon will implicitly search for and run the cron jobs defined in /etc/crontab, /etc/cron.d/* and /var/spool/cron/cronstabs/*.



    What is -p used for?



    Is it to explicitly tell cron to search for and run the cron jobs defined in a crontab file which is stored in some place other than those mentioned above?



    Or is it to copy a crontab file stored in some place other than those mentioned above to one of the places mentioned above?



    Does the cron on Debian or its derivatives have -p option? I don't find -p on the manpage of cron on Ubuntu.



    Thanks.










    share|improve this question

























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      In cron's manpage (cronie)



      -p Allows Cron to accept any user set crontables.


      I learned that cron daemon will implicitly search for and run the cron jobs defined in /etc/crontab, /etc/cron.d/* and /var/spool/cron/cronstabs/*.



      What is -p used for?



      Is it to explicitly tell cron to search for and run the cron jobs defined in a crontab file which is stored in some place other than those mentioned above?



      Or is it to copy a crontab file stored in some place other than those mentioned above to one of the places mentioned above?



      Does the cron on Debian or its derivatives have -p option? I don't find -p on the manpage of cron on Ubuntu.



      Thanks.










      share|improve this question















      In cron's manpage (cronie)



      -p Allows Cron to accept any user set crontables.


      I learned that cron daemon will implicitly search for and run the cron jobs defined in /etc/crontab, /etc/cron.d/* and /var/spool/cron/cronstabs/*.



      What is -p used for?



      Is it to explicitly tell cron to search for and run the cron jobs defined in a crontab file which is stored in some place other than those mentioned above?



      Or is it to copy a crontab file stored in some place other than those mentioned above to one of the places mentioned above?



      Does the cron on Debian or its derivatives have -p option? I don't find -p on the manpage of cron on Ubuntu.



      Thanks.







      cron






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 3 hours ago

























      asked 3 hours ago









      Tim

      24.5k69239426




      24.5k69239426




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          3
          down vote













          The CAVEATS section of the cronie's cron(8) man page says (emphasis mine):




          All crontab files have to be regular files or symlinks to regular
          files, they must not be executable or writable for anyone else but
          the owner. This requirement can be overridden by using the -p option
          on the crond command line.




          So it is in fact documented on the man page, although not in the most obvious location.






          share|improve this answer




















          • Thanks. Can the file argument to -p be anywhere in any filesystem, or must it be in either`/etc/cron.d/ or /varspool/cron/crontabs/?
            – Tim
            2 hours ago






          • 1




            The -p option takes no "file argument" and has no effect as to where the cron daemon looks for crontab files; it just switches the ownership/permission/filetype checks off. The cron daemon will still look for crontabs in three places: the file /etc/crontab, any files in directory /etc/cron.d/, and any files in directory /var/spool/cron/. These locations can apparently only be changed by modifying the cron source code.
            – telcoM
            2 hours ago

















          up vote
          2
          down vote













          Good question. It doesn't appear to be documented within the man page. Looking at the source, we see -p sets PermitAnyCrontab, see https://github.com/cronie-crond/cronie/blob/master/src/cron.c#L703



           case 'p':
          PermitAnyCrontab = 1;


          Which in turn gets used https://github.com/cronie-crond/cronie/blob/40b7164227a17058afb4f3d837ebb3263943e2e6/src/database.c#L89



          Makes cron less fussy about the crontab file's state (can be a non-regular file, can have a different owner, can have a mode that's not 400, can have a link count other than 1).



          if (PermitAnyCrontab == 0) 


          While it's clearly present within cronie, such a feature is not present in Vixie Cron (https://github.com/svagner/vixie-cron)






          share|improve this answer






















          • Thanks. Can such a crontab file specified by -p be stored anywhere? Must it be user-specific crontab file, not system crontab file?
            – Tim
            3 hours ago











          • It can be a symlink to elsewhere. All it does is bypass a safeguards / checks really. Note it's crond itself, not crontab.
            – steve
            3 hours ago











          • Do you mean the file argument to -p must still be in either`/etc/cron.d/ or /varspool/cron/crontabs/, not anywhere in any filesystem?
            – Tim
            3 hours ago











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f479254%2fwhat-is-p-used-for-cron%23new-answer', 'question_page');

          );

          Post as a guest






























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote













          The CAVEATS section of the cronie's cron(8) man page says (emphasis mine):




          All crontab files have to be regular files or symlinks to regular
          files, they must not be executable or writable for anyone else but
          the owner. This requirement can be overridden by using the -p option
          on the crond command line.




          So it is in fact documented on the man page, although not in the most obvious location.






          share|improve this answer




















          • Thanks. Can the file argument to -p be anywhere in any filesystem, or must it be in either`/etc/cron.d/ or /varspool/cron/crontabs/?
            – Tim
            2 hours ago






          • 1




            The -p option takes no "file argument" and has no effect as to where the cron daemon looks for crontab files; it just switches the ownership/permission/filetype checks off. The cron daemon will still look for crontabs in three places: the file /etc/crontab, any files in directory /etc/cron.d/, and any files in directory /var/spool/cron/. These locations can apparently only be changed by modifying the cron source code.
            – telcoM
            2 hours ago














          up vote
          3
          down vote













          The CAVEATS section of the cronie's cron(8) man page says (emphasis mine):




          All crontab files have to be regular files or symlinks to regular
          files, they must not be executable or writable for anyone else but
          the owner. This requirement can be overridden by using the -p option
          on the crond command line.




          So it is in fact documented on the man page, although not in the most obvious location.






          share|improve this answer




















          • Thanks. Can the file argument to -p be anywhere in any filesystem, or must it be in either`/etc/cron.d/ or /varspool/cron/crontabs/?
            – Tim
            2 hours ago






          • 1




            The -p option takes no "file argument" and has no effect as to where the cron daemon looks for crontab files; it just switches the ownership/permission/filetype checks off. The cron daemon will still look for crontabs in three places: the file /etc/crontab, any files in directory /etc/cron.d/, and any files in directory /var/spool/cron/. These locations can apparently only be changed by modifying the cron source code.
            – telcoM
            2 hours ago












          up vote
          3
          down vote










          up vote
          3
          down vote









          The CAVEATS section of the cronie's cron(8) man page says (emphasis mine):




          All crontab files have to be regular files or symlinks to regular
          files, they must not be executable or writable for anyone else but
          the owner. This requirement can be overridden by using the -p option
          on the crond command line.




          So it is in fact documented on the man page, although not in the most obvious location.






          share|improve this answer












          The CAVEATS section of the cronie's cron(8) man page says (emphasis mine):




          All crontab files have to be regular files or symlinks to regular
          files, they must not be executable or writable for anyone else but
          the owner. This requirement can be overridden by using the -p option
          on the crond command line.




          So it is in fact documented on the man page, although not in the most obvious location.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 3 hours ago









          telcoM

          13.6k11742




          13.6k11742











          • Thanks. Can the file argument to -p be anywhere in any filesystem, or must it be in either`/etc/cron.d/ or /varspool/cron/crontabs/?
            – Tim
            2 hours ago






          • 1




            The -p option takes no "file argument" and has no effect as to where the cron daemon looks for crontab files; it just switches the ownership/permission/filetype checks off. The cron daemon will still look for crontabs in three places: the file /etc/crontab, any files in directory /etc/cron.d/, and any files in directory /var/spool/cron/. These locations can apparently only be changed by modifying the cron source code.
            – telcoM
            2 hours ago
















          • Thanks. Can the file argument to -p be anywhere in any filesystem, or must it be in either`/etc/cron.d/ or /varspool/cron/crontabs/?
            – Tim
            2 hours ago






          • 1




            The -p option takes no "file argument" and has no effect as to where the cron daemon looks for crontab files; it just switches the ownership/permission/filetype checks off. The cron daemon will still look for crontabs in three places: the file /etc/crontab, any files in directory /etc/cron.d/, and any files in directory /var/spool/cron/. These locations can apparently only be changed by modifying the cron source code.
            – telcoM
            2 hours ago















          Thanks. Can the file argument to -p be anywhere in any filesystem, or must it be in either`/etc/cron.d/ or /varspool/cron/crontabs/?
          – Tim
          2 hours ago




          Thanks. Can the file argument to -p be anywhere in any filesystem, or must it be in either`/etc/cron.d/ or /varspool/cron/crontabs/?
          – Tim
          2 hours ago




          1




          1




          The -p option takes no "file argument" and has no effect as to where the cron daemon looks for crontab files; it just switches the ownership/permission/filetype checks off. The cron daemon will still look for crontabs in three places: the file /etc/crontab, any files in directory /etc/cron.d/, and any files in directory /var/spool/cron/. These locations can apparently only be changed by modifying the cron source code.
          – telcoM
          2 hours ago




          The -p option takes no "file argument" and has no effect as to where the cron daemon looks for crontab files; it just switches the ownership/permission/filetype checks off. The cron daemon will still look for crontabs in three places: the file /etc/crontab, any files in directory /etc/cron.d/, and any files in directory /var/spool/cron/. These locations can apparently only be changed by modifying the cron source code.
          – telcoM
          2 hours ago












          up vote
          2
          down vote













          Good question. It doesn't appear to be documented within the man page. Looking at the source, we see -p sets PermitAnyCrontab, see https://github.com/cronie-crond/cronie/blob/master/src/cron.c#L703



           case 'p':
          PermitAnyCrontab = 1;


          Which in turn gets used https://github.com/cronie-crond/cronie/blob/40b7164227a17058afb4f3d837ebb3263943e2e6/src/database.c#L89



          Makes cron less fussy about the crontab file's state (can be a non-regular file, can have a different owner, can have a mode that's not 400, can have a link count other than 1).



          if (PermitAnyCrontab == 0) 


          While it's clearly present within cronie, such a feature is not present in Vixie Cron (https://github.com/svagner/vixie-cron)






          share|improve this answer






















          • Thanks. Can such a crontab file specified by -p be stored anywhere? Must it be user-specific crontab file, not system crontab file?
            – Tim
            3 hours ago











          • It can be a symlink to elsewhere. All it does is bypass a safeguards / checks really. Note it's crond itself, not crontab.
            – steve
            3 hours ago











          • Do you mean the file argument to -p must still be in either`/etc/cron.d/ or /varspool/cron/crontabs/, not anywhere in any filesystem?
            – Tim
            3 hours ago















          up vote
          2
          down vote













          Good question. It doesn't appear to be documented within the man page. Looking at the source, we see -p sets PermitAnyCrontab, see https://github.com/cronie-crond/cronie/blob/master/src/cron.c#L703



           case 'p':
          PermitAnyCrontab = 1;


          Which in turn gets used https://github.com/cronie-crond/cronie/blob/40b7164227a17058afb4f3d837ebb3263943e2e6/src/database.c#L89



          Makes cron less fussy about the crontab file's state (can be a non-regular file, can have a different owner, can have a mode that's not 400, can have a link count other than 1).



          if (PermitAnyCrontab == 0) 


          While it's clearly present within cronie, such a feature is not present in Vixie Cron (https://github.com/svagner/vixie-cron)






          share|improve this answer






















          • Thanks. Can such a crontab file specified by -p be stored anywhere? Must it be user-specific crontab file, not system crontab file?
            – Tim
            3 hours ago











          • It can be a symlink to elsewhere. All it does is bypass a safeguards / checks really. Note it's crond itself, not crontab.
            – steve
            3 hours ago











          • Do you mean the file argument to -p must still be in either`/etc/cron.d/ or /varspool/cron/crontabs/, not anywhere in any filesystem?
            – Tim
            3 hours ago













          up vote
          2
          down vote










          up vote
          2
          down vote









          Good question. It doesn't appear to be documented within the man page. Looking at the source, we see -p sets PermitAnyCrontab, see https://github.com/cronie-crond/cronie/blob/master/src/cron.c#L703



           case 'p':
          PermitAnyCrontab = 1;


          Which in turn gets used https://github.com/cronie-crond/cronie/blob/40b7164227a17058afb4f3d837ebb3263943e2e6/src/database.c#L89



          Makes cron less fussy about the crontab file's state (can be a non-regular file, can have a different owner, can have a mode that's not 400, can have a link count other than 1).



          if (PermitAnyCrontab == 0) 


          While it's clearly present within cronie, such a feature is not present in Vixie Cron (https://github.com/svagner/vixie-cron)






          share|improve this answer














          Good question. It doesn't appear to be documented within the man page. Looking at the source, we see -p sets PermitAnyCrontab, see https://github.com/cronie-crond/cronie/blob/master/src/cron.c#L703



           case 'p':
          PermitAnyCrontab = 1;


          Which in turn gets used https://github.com/cronie-crond/cronie/blob/40b7164227a17058afb4f3d837ebb3263943e2e6/src/database.c#L89



          Makes cron less fussy about the crontab file's state (can be a non-regular file, can have a different owner, can have a mode that's not 400, can have a link count other than 1).



          if (PermitAnyCrontab == 0) 


          While it's clearly present within cronie, such a feature is not present in Vixie Cron (https://github.com/svagner/vixie-cron)







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 3 hours ago

























          answered 3 hours ago









          steve

          13.3k22251




          13.3k22251











          • Thanks. Can such a crontab file specified by -p be stored anywhere? Must it be user-specific crontab file, not system crontab file?
            – Tim
            3 hours ago











          • It can be a symlink to elsewhere. All it does is bypass a safeguards / checks really. Note it's crond itself, not crontab.
            – steve
            3 hours ago











          • Do you mean the file argument to -p must still be in either`/etc/cron.d/ or /varspool/cron/crontabs/, not anywhere in any filesystem?
            – Tim
            3 hours ago

















          • Thanks. Can such a crontab file specified by -p be stored anywhere? Must it be user-specific crontab file, not system crontab file?
            – Tim
            3 hours ago











          • It can be a symlink to elsewhere. All it does is bypass a safeguards / checks really. Note it's crond itself, not crontab.
            – steve
            3 hours ago











          • Do you mean the file argument to -p must still be in either`/etc/cron.d/ or /varspool/cron/crontabs/, not anywhere in any filesystem?
            – Tim
            3 hours ago
















          Thanks. Can such a crontab file specified by -p be stored anywhere? Must it be user-specific crontab file, not system crontab file?
          – Tim
          3 hours ago





          Thanks. Can such a crontab file specified by -p be stored anywhere? Must it be user-specific crontab file, not system crontab file?
          – Tim
          3 hours ago













          It can be a symlink to elsewhere. All it does is bypass a safeguards / checks really. Note it's crond itself, not crontab.
          – steve
          3 hours ago





          It can be a symlink to elsewhere. All it does is bypass a safeguards / checks really. Note it's crond itself, not crontab.
          – steve
          3 hours ago













          Do you mean the file argument to -p must still be in either`/etc/cron.d/ or /varspool/cron/crontabs/, not anywhere in any filesystem?
          – Tim
          3 hours ago





          Do you mean the file argument to -p must still be in either`/etc/cron.d/ or /varspool/cron/crontabs/, not anywhere in any filesystem?
          – Tim
          3 hours ago


















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f479254%2fwhat-is-p-used-for-cron%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          Long meetings (6-7 hours a day): Being “babysat” by supervisor

          Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

          Confectionery