how to temporarily disable a user's cronjobs?

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











up vote
12
down vote

favorite
2












How do I temporarily disable one or more users' cron jobs? In particular, I do not want to suspend the user's cron rights - merely not fire any of their jobs.



I am on SLES 11 SP2 and SP3 systems










share|improve this question























  • Can't you just use the -u user switch of the crontab command and put a # comment character in front of the jobs to disable for the given user?
    – Janis
    Mar 6 '15 at 0:41











  • @Janis then I need to keep track of what the user (there are many) had already commented out, plus the user can go ahead and add another thing in (I am not adding them to /etc/cron.deny). Too much manual work :(
    – Dinesh
    Mar 6 '15 at 0:49











  • Dinesh, I (mis-)understood you want a fine-granular control about what you disable.
    – Janis
    Mar 6 '15 at 1:00














up vote
12
down vote

favorite
2












How do I temporarily disable one or more users' cron jobs? In particular, I do not want to suspend the user's cron rights - merely not fire any of their jobs.



I am on SLES 11 SP2 and SP3 systems










share|improve this question























  • Can't you just use the -u user switch of the crontab command and put a # comment character in front of the jobs to disable for the given user?
    – Janis
    Mar 6 '15 at 0:41











  • @Janis then I need to keep track of what the user (there are many) had already commented out, plus the user can go ahead and add another thing in (I am not adding them to /etc/cron.deny). Too much manual work :(
    – Dinesh
    Mar 6 '15 at 0:49











  • Dinesh, I (mis-)understood you want a fine-granular control about what you disable.
    – Janis
    Mar 6 '15 at 1:00












up vote
12
down vote

favorite
2









up vote
12
down vote

favorite
2






2





How do I temporarily disable one or more users' cron jobs? In particular, I do not want to suspend the user's cron rights - merely not fire any of their jobs.



I am on SLES 11 SP2 and SP3 systems










share|improve this question















How do I temporarily disable one or more users' cron jobs? In particular, I do not want to suspend the user's cron rights - merely not fire any of their jobs.



I am on SLES 11 SP2 and SP3 systems







cron






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 6 '15 at 3:14

























asked Mar 6 '15 at 0:36









Dinesh

3662515




3662515











  • Can't you just use the -u user switch of the crontab command and put a # comment character in front of the jobs to disable for the given user?
    – Janis
    Mar 6 '15 at 0:41











  • @Janis then I need to keep track of what the user (there are many) had already commented out, plus the user can go ahead and add another thing in (I am not adding them to /etc/cron.deny). Too much manual work :(
    – Dinesh
    Mar 6 '15 at 0:49











  • Dinesh, I (mis-)understood you want a fine-granular control about what you disable.
    – Janis
    Mar 6 '15 at 1:00
















  • Can't you just use the -u user switch of the crontab command and put a # comment character in front of the jobs to disable for the given user?
    – Janis
    Mar 6 '15 at 0:41











  • @Janis then I need to keep track of what the user (there are many) had already commented out, plus the user can go ahead and add another thing in (I am not adding them to /etc/cron.deny). Too much manual work :(
    – Dinesh
    Mar 6 '15 at 0:49











  • Dinesh, I (mis-)understood you want a fine-granular control about what you disable.
    – Janis
    Mar 6 '15 at 1:00















Can't you just use the -u user switch of the crontab command and put a # comment character in front of the jobs to disable for the given user?
– Janis
Mar 6 '15 at 0:41





Can't you just use the -u user switch of the crontab command and put a # comment character in front of the jobs to disable for the given user?
– Janis
Mar 6 '15 at 0:41













@Janis then I need to keep track of what the user (there are many) had already commented out, plus the user can go ahead and add another thing in (I am not adding them to /etc/cron.deny). Too much manual work :(
– Dinesh
Mar 6 '15 at 0:49





@Janis then I need to keep track of what the user (there are many) had already commented out, plus the user can go ahead and add another thing in (I am not adding them to /etc/cron.deny). Too much manual work :(
– Dinesh
Mar 6 '15 at 0:49













Dinesh, I (mis-)understood you want a fine-granular control about what you disable.
– Janis
Mar 6 '15 at 1:00




Dinesh, I (mis-)understood you want a fine-granular control about what you disable.
– Janis
Mar 6 '15 at 1:00










5 Answers
5






active

oldest

votes

















up vote
8
down vote



accepted










touch /var/spool/cron/crontabs/$username; chmod 0 /var/spool/cron/crontabs/$username should do the trick. Restore with chmod 600 and touch (you need to change the file's mtime to make cron (attempt to) reload it).



On at least Debian and probably with Vixie cron in general, chmod 400 /var/spool/cron/crontabs/$username also does the trick, because that implementation insists on permissions being exactly 600. However this only lasts until the user runs the crontab command.



If you want a robust way, I don't think there's anything better than temporarily moving their crontab out of the way or changing the permissions, and temporarily adding them to /etc/cron.deny.






share|improve this answer






















  • Thanks. On my system it is /var/spool/cron/tabs/$username. But it still executes, even after the chmod.
    – Dinesh
    Mar 6 '15 at 3:19










  • After changing the file perms, I also needed to stop/restart cron. I thought its probably because cron might be holding the stuff in memory. So I added touch $username after the chmod. But that didn't help. (btw got your point on cron.deny)
    – Dinesh
    Mar 6 '15 at 3:28










  • @Dinesh Indeed you need to update the file's mtime or else cron thinks it hasn't changed and keeps cached information. I noticed this while testing yesterday but forgot to mention it in my answer, sorry about that.
    – Gilles
    Mar 7 '15 at 0:17










  • If you want to disable for all standard users just: chgrp root /var/spool/cron/crontabs
    – shrimpwagon
    Aug 25 '15 at 22:11

















up vote
5
down vote













How about something like this to disable a user crontab:



crontab -l -u [username] >/tmp/[username].cron.tmp
crontab -r -u [username]


and to re-enable:



crontab -u [username] /tmp/[username].cron.tmp


This has the added advantage that you can run it as that user without needing root (just take the -u parameter away).






share|improve this answer



























    up vote
    0
    down vote













    If you're using Debian, this only applies to Debian AFAIK:



    You can do so by adding a dot to the name of the cronjob.



    Behavior is referred to on the Debian official docs:



    https://www.debian.org/doc/debian-policy/#cron-job-file-names




    A cron job file name must not include any period or plus characters (.
    or +) characters as this will cause cron to ignore the file.
    Underscores (_) should be used instead of . and + characters.







    share|improve this answer



























      up vote
      -1
      down vote













      I agree, the path via systemctl is the one to take.
      On raspberry, toe comands would be



      sudo systemctl stop cron.service
      sudo systemctl start cron.service





      share|improve this answer










      New contributor




      Juergen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

















      • This will stop the entire cron service. The OP wanted to be able to choose which users' crontabs to disable.
        – roaima
        Oct 4 at 10:25










      • It's also identical to another answer.
        – roaima
        Oct 4 at 10:25

















      up vote
      -1
      down vote













      If you just want to stop all cron jobs entirely for a while -- for example, while doing system maintenance which they might interact badly with -- the commands are normally



      systemctl stop crond.service


      and, to resume



      systemctl start crond.service


      I presume you need root or wheel authority to execute those; if necessary, run them via sudo or (last resort) log in as root.



      Overkill for the specific question posed, but provides "one-stop shopping" and doesn't require playing with the filesystem or temporary files.






      share|improve this answer


















      • 2




        Since this disables cron for all users, it doesn’t really answer the question.
        – Scott
        Nov 30 '17 at 6:34










      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: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      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%2f188501%2fhow-to-temporarily-disable-a-users-cronjobs%23new-answer', 'question_page');

      );

      Post as a guest






























      5 Answers
      5






      active

      oldest

      votes








      5 Answers
      5






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      8
      down vote



      accepted










      touch /var/spool/cron/crontabs/$username; chmod 0 /var/spool/cron/crontabs/$username should do the trick. Restore with chmod 600 and touch (you need to change the file's mtime to make cron (attempt to) reload it).



      On at least Debian and probably with Vixie cron in general, chmod 400 /var/spool/cron/crontabs/$username also does the trick, because that implementation insists on permissions being exactly 600. However this only lasts until the user runs the crontab command.



      If you want a robust way, I don't think there's anything better than temporarily moving their crontab out of the way or changing the permissions, and temporarily adding them to /etc/cron.deny.






      share|improve this answer






















      • Thanks. On my system it is /var/spool/cron/tabs/$username. But it still executes, even after the chmod.
        – Dinesh
        Mar 6 '15 at 3:19










      • After changing the file perms, I also needed to stop/restart cron. I thought its probably because cron might be holding the stuff in memory. So I added touch $username after the chmod. But that didn't help. (btw got your point on cron.deny)
        – Dinesh
        Mar 6 '15 at 3:28










      • @Dinesh Indeed you need to update the file's mtime or else cron thinks it hasn't changed and keeps cached information. I noticed this while testing yesterday but forgot to mention it in my answer, sorry about that.
        – Gilles
        Mar 7 '15 at 0:17










      • If you want to disable for all standard users just: chgrp root /var/spool/cron/crontabs
        – shrimpwagon
        Aug 25 '15 at 22:11














      up vote
      8
      down vote



      accepted










      touch /var/spool/cron/crontabs/$username; chmod 0 /var/spool/cron/crontabs/$username should do the trick. Restore with chmod 600 and touch (you need to change the file's mtime to make cron (attempt to) reload it).



      On at least Debian and probably with Vixie cron in general, chmod 400 /var/spool/cron/crontabs/$username also does the trick, because that implementation insists on permissions being exactly 600. However this only lasts until the user runs the crontab command.



      If you want a robust way, I don't think there's anything better than temporarily moving their crontab out of the way or changing the permissions, and temporarily adding them to /etc/cron.deny.






      share|improve this answer






















      • Thanks. On my system it is /var/spool/cron/tabs/$username. But it still executes, even after the chmod.
        – Dinesh
        Mar 6 '15 at 3:19










      • After changing the file perms, I also needed to stop/restart cron. I thought its probably because cron might be holding the stuff in memory. So I added touch $username after the chmod. But that didn't help. (btw got your point on cron.deny)
        – Dinesh
        Mar 6 '15 at 3:28










      • @Dinesh Indeed you need to update the file's mtime or else cron thinks it hasn't changed and keeps cached information. I noticed this while testing yesterday but forgot to mention it in my answer, sorry about that.
        – Gilles
        Mar 7 '15 at 0:17










      • If you want to disable for all standard users just: chgrp root /var/spool/cron/crontabs
        – shrimpwagon
        Aug 25 '15 at 22:11












      up vote
      8
      down vote



      accepted







      up vote
      8
      down vote



      accepted






      touch /var/spool/cron/crontabs/$username; chmod 0 /var/spool/cron/crontabs/$username should do the trick. Restore with chmod 600 and touch (you need to change the file's mtime to make cron (attempt to) reload it).



      On at least Debian and probably with Vixie cron in general, chmod 400 /var/spool/cron/crontabs/$username also does the trick, because that implementation insists on permissions being exactly 600. However this only lasts until the user runs the crontab command.



      If you want a robust way, I don't think there's anything better than temporarily moving their crontab out of the way or changing the permissions, and temporarily adding them to /etc/cron.deny.






      share|improve this answer














      touch /var/spool/cron/crontabs/$username; chmod 0 /var/spool/cron/crontabs/$username should do the trick. Restore with chmod 600 and touch (you need to change the file's mtime to make cron (attempt to) reload it).



      On at least Debian and probably with Vixie cron in general, chmod 400 /var/spool/cron/crontabs/$username also does the trick, because that implementation insists on permissions being exactly 600. However this only lasts until the user runs the crontab command.



      If you want a robust way, I don't think there's anything better than temporarily moving their crontab out of the way or changing the permissions, and temporarily adding them to /etc/cron.deny.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Aug 25 '15 at 21:40









      shrimpwagon

      1922410




      1922410










      answered Mar 6 '15 at 0:55









      Gilles

      513k12010151547




      513k12010151547











      • Thanks. On my system it is /var/spool/cron/tabs/$username. But it still executes, even after the chmod.
        – Dinesh
        Mar 6 '15 at 3:19










      • After changing the file perms, I also needed to stop/restart cron. I thought its probably because cron might be holding the stuff in memory. So I added touch $username after the chmod. But that didn't help. (btw got your point on cron.deny)
        – Dinesh
        Mar 6 '15 at 3:28










      • @Dinesh Indeed you need to update the file's mtime or else cron thinks it hasn't changed and keeps cached information. I noticed this while testing yesterday but forgot to mention it in my answer, sorry about that.
        – Gilles
        Mar 7 '15 at 0:17










      • If you want to disable for all standard users just: chgrp root /var/spool/cron/crontabs
        – shrimpwagon
        Aug 25 '15 at 22:11
















      • Thanks. On my system it is /var/spool/cron/tabs/$username. But it still executes, even after the chmod.
        – Dinesh
        Mar 6 '15 at 3:19










      • After changing the file perms, I also needed to stop/restart cron. I thought its probably because cron might be holding the stuff in memory. So I added touch $username after the chmod. But that didn't help. (btw got your point on cron.deny)
        – Dinesh
        Mar 6 '15 at 3:28










      • @Dinesh Indeed you need to update the file's mtime or else cron thinks it hasn't changed and keeps cached information. I noticed this while testing yesterday but forgot to mention it in my answer, sorry about that.
        – Gilles
        Mar 7 '15 at 0:17










      • If you want to disable for all standard users just: chgrp root /var/spool/cron/crontabs
        – shrimpwagon
        Aug 25 '15 at 22:11















      Thanks. On my system it is /var/spool/cron/tabs/$username. But it still executes, even after the chmod.
      – Dinesh
      Mar 6 '15 at 3:19




      Thanks. On my system it is /var/spool/cron/tabs/$username. But it still executes, even after the chmod.
      – Dinesh
      Mar 6 '15 at 3:19












      After changing the file perms, I also needed to stop/restart cron. I thought its probably because cron might be holding the stuff in memory. So I added touch $username after the chmod. But that didn't help. (btw got your point on cron.deny)
      – Dinesh
      Mar 6 '15 at 3:28




      After changing the file perms, I also needed to stop/restart cron. I thought its probably because cron might be holding the stuff in memory. So I added touch $username after the chmod. But that didn't help. (btw got your point on cron.deny)
      – Dinesh
      Mar 6 '15 at 3:28












      @Dinesh Indeed you need to update the file's mtime or else cron thinks it hasn't changed and keeps cached information. I noticed this while testing yesterday but forgot to mention it in my answer, sorry about that.
      – Gilles
      Mar 7 '15 at 0:17




      @Dinesh Indeed you need to update the file's mtime or else cron thinks it hasn't changed and keeps cached information. I noticed this while testing yesterday but forgot to mention it in my answer, sorry about that.
      – Gilles
      Mar 7 '15 at 0:17












      If you want to disable for all standard users just: chgrp root /var/spool/cron/crontabs
      – shrimpwagon
      Aug 25 '15 at 22:11




      If you want to disable for all standard users just: chgrp root /var/spool/cron/crontabs
      – shrimpwagon
      Aug 25 '15 at 22:11












      up vote
      5
      down vote













      How about something like this to disable a user crontab:



      crontab -l -u [username] >/tmp/[username].cron.tmp
      crontab -r -u [username]


      and to re-enable:



      crontab -u [username] /tmp/[username].cron.tmp


      This has the added advantage that you can run it as that user without needing root (just take the -u parameter away).






      share|improve this answer
























        up vote
        5
        down vote













        How about something like this to disable a user crontab:



        crontab -l -u [username] >/tmp/[username].cron.tmp
        crontab -r -u [username]


        and to re-enable:



        crontab -u [username] /tmp/[username].cron.tmp


        This has the added advantage that you can run it as that user without needing root (just take the -u parameter away).






        share|improve this answer






















          up vote
          5
          down vote










          up vote
          5
          down vote









          How about something like this to disable a user crontab:



          crontab -l -u [username] >/tmp/[username].cron.tmp
          crontab -r -u [username]


          and to re-enable:



          crontab -u [username] /tmp/[username].cron.tmp


          This has the added advantage that you can run it as that user without needing root (just take the -u parameter away).






          share|improve this answer












          How about something like this to disable a user crontab:



          crontab -l -u [username] >/tmp/[username].cron.tmp
          crontab -r -u [username]


          and to re-enable:



          crontab -u [username] /tmp/[username].cron.tmp


          This has the added advantage that you can run it as that user without needing root (just take the -u parameter away).







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 30 '16 at 9:16









          braindigitalis

          15913




          15913




















              up vote
              0
              down vote













              If you're using Debian, this only applies to Debian AFAIK:



              You can do so by adding a dot to the name of the cronjob.



              Behavior is referred to on the Debian official docs:



              https://www.debian.org/doc/debian-policy/#cron-job-file-names




              A cron job file name must not include any period or plus characters (.
              or +) characters as this will cause cron to ignore the file.
              Underscores (_) should be used instead of . and + characters.







              share|improve this answer
























                up vote
                0
                down vote













                If you're using Debian, this only applies to Debian AFAIK:



                You can do so by adding a dot to the name of the cronjob.



                Behavior is referred to on the Debian official docs:



                https://www.debian.org/doc/debian-policy/#cron-job-file-names




                A cron job file name must not include any period or plus characters (.
                or +) characters as this will cause cron to ignore the file.
                Underscores (_) should be used instead of . and + characters.







                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  If you're using Debian, this only applies to Debian AFAIK:



                  You can do so by adding a dot to the name of the cronjob.



                  Behavior is referred to on the Debian official docs:



                  https://www.debian.org/doc/debian-policy/#cron-job-file-names




                  A cron job file name must not include any period or plus characters (.
                  or +) characters as this will cause cron to ignore the file.
                  Underscores (_) should be used instead of . and + characters.







                  share|improve this answer












                  If you're using Debian, this only applies to Debian AFAIK:



                  You can do so by adding a dot to the name of the cronjob.



                  Behavior is referred to on the Debian official docs:



                  https://www.debian.org/doc/debian-policy/#cron-job-file-names




                  A cron job file name must not include any period or plus characters (.
                  or +) characters as this will cause cron to ignore the file.
                  Underscores (_) should be used instead of . and + characters.








                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 9 at 17:16









                  Wadih M.

                  491212




                  491212




















                      up vote
                      -1
                      down vote













                      I agree, the path via systemctl is the one to take.
                      On raspberry, toe comands would be



                      sudo systemctl stop cron.service
                      sudo systemctl start cron.service





                      share|improve this answer










                      New contributor




                      Juergen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.

















                      • This will stop the entire cron service. The OP wanted to be able to choose which users' crontabs to disable.
                        – roaima
                        Oct 4 at 10:25










                      • It's also identical to another answer.
                        – roaima
                        Oct 4 at 10:25














                      up vote
                      -1
                      down vote













                      I agree, the path via systemctl is the one to take.
                      On raspberry, toe comands would be



                      sudo systemctl stop cron.service
                      sudo systemctl start cron.service





                      share|improve this answer










                      New contributor




                      Juergen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.

















                      • This will stop the entire cron service. The OP wanted to be able to choose which users' crontabs to disable.
                        – roaima
                        Oct 4 at 10:25










                      • It's also identical to another answer.
                        – roaima
                        Oct 4 at 10:25












                      up vote
                      -1
                      down vote










                      up vote
                      -1
                      down vote









                      I agree, the path via systemctl is the one to take.
                      On raspberry, toe comands would be



                      sudo systemctl stop cron.service
                      sudo systemctl start cron.service





                      share|improve this answer










                      New contributor




                      Juergen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      I agree, the path via systemctl is the one to take.
                      On raspberry, toe comands would be



                      sudo systemctl stop cron.service
                      sudo systemctl start cron.service






                      share|improve this answer










                      New contributor




                      Juergen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      share|improve this answer



                      share|improve this answer








                      edited Oct 4 at 10:07









                      jimmij

                      29.5k867101




                      29.5k867101






                      New contributor




                      Juergen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      answered Oct 4 at 9:57









                      Juergen

                      1




                      1




                      New contributor




                      Juergen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.





                      New contributor





                      Juergen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.






                      Juergen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.











                      • This will stop the entire cron service. The OP wanted to be able to choose which users' crontabs to disable.
                        – roaima
                        Oct 4 at 10:25










                      • It's also identical to another answer.
                        – roaima
                        Oct 4 at 10:25
















                      • This will stop the entire cron service. The OP wanted to be able to choose which users' crontabs to disable.
                        – roaima
                        Oct 4 at 10:25










                      • It's also identical to another answer.
                        – roaima
                        Oct 4 at 10:25















                      This will stop the entire cron service. The OP wanted to be able to choose which users' crontabs to disable.
                      – roaima
                      Oct 4 at 10:25




                      This will stop the entire cron service. The OP wanted to be able to choose which users' crontabs to disable.
                      – roaima
                      Oct 4 at 10:25












                      It's also identical to another answer.
                      – roaima
                      Oct 4 at 10:25




                      It's also identical to another answer.
                      – roaima
                      Oct 4 at 10:25










                      up vote
                      -1
                      down vote













                      If you just want to stop all cron jobs entirely for a while -- for example, while doing system maintenance which they might interact badly with -- the commands are normally



                      systemctl stop crond.service


                      and, to resume



                      systemctl start crond.service


                      I presume you need root or wheel authority to execute those; if necessary, run them via sudo or (last resort) log in as root.



                      Overkill for the specific question posed, but provides "one-stop shopping" and doesn't require playing with the filesystem or temporary files.






                      share|improve this answer


















                      • 2




                        Since this disables cron for all users, it doesn’t really answer the question.
                        – Scott
                        Nov 30 '17 at 6:34














                      up vote
                      -1
                      down vote













                      If you just want to stop all cron jobs entirely for a while -- for example, while doing system maintenance which they might interact badly with -- the commands are normally



                      systemctl stop crond.service


                      and, to resume



                      systemctl start crond.service


                      I presume you need root or wheel authority to execute those; if necessary, run them via sudo or (last resort) log in as root.



                      Overkill for the specific question posed, but provides "one-stop shopping" and doesn't require playing with the filesystem or temporary files.






                      share|improve this answer


















                      • 2




                        Since this disables cron for all users, it doesn’t really answer the question.
                        – Scott
                        Nov 30 '17 at 6:34












                      up vote
                      -1
                      down vote










                      up vote
                      -1
                      down vote









                      If you just want to stop all cron jobs entirely for a while -- for example, while doing system maintenance which they might interact badly with -- the commands are normally



                      systemctl stop crond.service


                      and, to resume



                      systemctl start crond.service


                      I presume you need root or wheel authority to execute those; if necessary, run them via sudo or (last resort) log in as root.



                      Overkill for the specific question posed, but provides "one-stop shopping" and doesn't require playing with the filesystem or temporary files.






                      share|improve this answer














                      If you just want to stop all cron jobs entirely for a while -- for example, while doing system maintenance which they might interact badly with -- the commands are normally



                      systemctl stop crond.service


                      and, to resume



                      systemctl start crond.service


                      I presume you need root or wheel authority to execute those; if necessary, run them via sudo or (last resort) log in as root.



                      Overkill for the specific question posed, but provides "one-stop shopping" and doesn't require playing with the filesystem or temporary files.







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Oct 4 at 10:26









                      roaima

                      40.9k547111




                      40.9k547111










                      answered Nov 30 '17 at 5:03









                      Felix Domestica

                      11




                      11







                      • 2




                        Since this disables cron for all users, it doesn’t really answer the question.
                        – Scott
                        Nov 30 '17 at 6:34












                      • 2




                        Since this disables cron for all users, it doesn’t really answer the question.
                        – Scott
                        Nov 30 '17 at 6:34







                      2




                      2




                      Since this disables cron for all users, it doesn’t really answer the question.
                      – Scott
                      Nov 30 '17 at 6:34




                      Since this disables cron for all users, it doesn’t really answer the question.
                      – Scott
                      Nov 30 '17 at 6:34

















                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f188501%2fhow-to-temporarily-disable-a-users-cronjobs%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Displaying single band from multi-band raster using QGIS

                      How many registers does an x86_64 CPU actually have?