System Crontab or Root Crontab The 2019 Stack Overflow Developer Survey Results Are InAre there disadvantages/consequences to adding scheduled tasks directly to /etc/crontab instead of using the crontab command?What is the difference between using crontab -e and /etc/crontabExecute script at crontabWays to execute shell command as root?How do I add an entry to my crontab?Running program as root without using sudo with normal user accountHow to autostart a background program by a non-root user?Crontab does not run?OpenSUSE disabled root login (no root psswd set) >> yast, config issuesCrontab: Why won't it execute scriptnotify-send from root cronAdding/removing jobs in Debian crontab files?Differences between `/etc/crontab`, files under `/etc/cron.d/` and `/var/spool/cron/crontabs/root`?

Do these rules for Critical Successes and Critical Failures seem Fair?

How to notate time signature switching consistently every measure

What do the Banks children have against barley water?

Does a dangling wire really electrocute me if I'm standing in water?

Protecting Dualbooting Windows from dangerous code (like rm -rf)

Earliest use of the term "Galois extension"?

Can one be advised by a professor who is very far away?

How can I autofill dates in Excel excluding Sunday?

Are there incongruent pythagorean triangles with the same perimeter and same area?

Is bread bad for ducks?

Why hard-Brexiteers don't insist on a hard border to prevent illegal immigration after Brexit?

"as much details as you can remember"

Why is the maximum length of OpenWrt’s root password 8 characters?

Can someone be penalized for an "unlawful" act if no penalty is specified?

What is the closest word meaning "respect for time / mindful"

Is an up-to-date browser secure on an out-of-date OS?

How come people say “Would of”?

Deal with toxic manager when you can't quit

Is three citations per paragraph excessive for undergraduate research paper?

Is a "Democratic" Oligarchy-Style System Possible?

Can a rogue use sneak attack with weapons that have the thrown property even if they are not thrown?

Is this app Icon Browser Safe/Legit?

What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?

Why isn't the circumferential light around the M87 black hole's event horizon symmetric?



System Crontab or Root Crontab



The 2019 Stack Overflow Developer Survey Results Are InAre there disadvantages/consequences to adding scheduled tasks directly to /etc/crontab instead of using the crontab command?What is the difference between using crontab -e and /etc/crontabExecute script at crontabWays to execute shell command as root?How do I add an entry to my crontab?Running program as root without using sudo with normal user accountHow to autostart a background program by a non-root user?Crontab does not run?OpenSUSE disabled root login (no root psswd set) >> yast, config issuesCrontab: Why won't it execute scriptnotify-send from root cronAdding/removing jobs in Debian crontab files?Differences between `/etc/crontab`, files under `/etc/cron.d/` and `/var/spool/cron/crontabs/root`?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








9















System crontab:



/etc/crontab


Root crontab:



sudo crontab -u root -e


Which way is preferred? As they all run tasks within administration privilege.










share|improve this question




























    9















    System crontab:



    /etc/crontab


    Root crontab:



    sudo crontab -u root -e


    Which way is preferred? As they all run tasks within administration privilege.










    share|improve this question
























      9












      9








      9


      4






      System crontab:



      /etc/crontab


      Root crontab:



      sudo crontab -u root -e


      Which way is preferred? As they all run tasks within administration privilege.










      share|improve this question














      System crontab:



      /etc/crontab


      Root crontab:



      sudo crontab -u root -e


      Which way is preferred? As they all run tasks within administration privilege.







      sudo cron root






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 3 '14 at 22:02









      PeiPei

      216148




      216148




















          2 Answers
          2






          active

          oldest

          votes


















          13














          /etc/crontab is the system wide crontab.



          The format of /etc/crontab is like this:



          # m h dom mon dow user command
          * * * * * someuser echo 'foo'


          while crontab -e is per user, it's worth mentioning with no -u argument the crontab command goes to the current users crontab. You can do crontab -e -u <username> to edit a specific users crontab.



          Notice in a per user crontab there is no 'user' field.



          # m h dom mon dow command
          * * * * * echo 'foo'


          An aspect of crontabs that may be confusing is that root also has its own crontab. e.g. crontab -e -u root will not edit /etc/crontab See Configuring cron.



          In Linux distros, per user crontabs are typically stored in: /var/spool/crontabs/<username>



          References



          https://superuser.com/questions/290093/difference-between-etc-crontab-and-crontab-e






          share|improve this answer




















          • 2





            As Congiruring cron says: there is usually no need to create a user crontab for root. Is that true? I mean the standard way is to edit the /etc/crontab, am I right?

            – Pei
            May 3 '14 at 22:32







          • 2





            There is no "standard" way, thus you can have both files. I usually edit root's crontab and avoit /etc/crontab just becaused I am used to crontab -e

            – phoops
            May 3 '14 at 22:35


















          7














          /etc/cron.d (and its siblings cron.daily/weekly/monthly) is preferred for all system crontabs. You shouldn't need to touch /etc/crontab.



          It's essential to separate cron entries in multiple files, based on their functionality if you are planing to manage or automate things. Files under /etc/cron.d can be easily managed by packages or configuration management tools like puppet and chef. Root's crontab OTOH is practically un-maintenable by anything other than humans.



          So in short, for system stuff you can use /etc/cron.*. If there's something you would like the root user to do then use root's crontab. /etc/crontab should be left untouched and managed by a package.






          share|improve this answer

























            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',
            autoActivateHeartbeat: false,
            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%2f127732%2fsystem-crontab-or-root-crontab%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            13














            /etc/crontab is the system wide crontab.



            The format of /etc/crontab is like this:



            # m h dom mon dow user command
            * * * * * someuser echo 'foo'


            while crontab -e is per user, it's worth mentioning with no -u argument the crontab command goes to the current users crontab. You can do crontab -e -u <username> to edit a specific users crontab.



            Notice in a per user crontab there is no 'user' field.



            # m h dom mon dow command
            * * * * * echo 'foo'


            An aspect of crontabs that may be confusing is that root also has its own crontab. e.g. crontab -e -u root will not edit /etc/crontab See Configuring cron.



            In Linux distros, per user crontabs are typically stored in: /var/spool/crontabs/<username>



            References



            https://superuser.com/questions/290093/difference-between-etc-crontab-and-crontab-e






            share|improve this answer




















            • 2





              As Congiruring cron says: there is usually no need to create a user crontab for root. Is that true? I mean the standard way is to edit the /etc/crontab, am I right?

              – Pei
              May 3 '14 at 22:32







            • 2





              There is no "standard" way, thus you can have both files. I usually edit root's crontab and avoit /etc/crontab just becaused I am used to crontab -e

              – phoops
              May 3 '14 at 22:35















            13














            /etc/crontab is the system wide crontab.



            The format of /etc/crontab is like this:



            # m h dom mon dow user command
            * * * * * someuser echo 'foo'


            while crontab -e is per user, it's worth mentioning with no -u argument the crontab command goes to the current users crontab. You can do crontab -e -u <username> to edit a specific users crontab.



            Notice in a per user crontab there is no 'user' field.



            # m h dom mon dow command
            * * * * * echo 'foo'


            An aspect of crontabs that may be confusing is that root also has its own crontab. e.g. crontab -e -u root will not edit /etc/crontab See Configuring cron.



            In Linux distros, per user crontabs are typically stored in: /var/spool/crontabs/<username>



            References



            https://superuser.com/questions/290093/difference-between-etc-crontab-and-crontab-e






            share|improve this answer




















            • 2





              As Congiruring cron says: there is usually no need to create a user crontab for root. Is that true? I mean the standard way is to edit the /etc/crontab, am I right?

              – Pei
              May 3 '14 at 22:32







            • 2





              There is no "standard" way, thus you can have both files. I usually edit root's crontab and avoit /etc/crontab just becaused I am used to crontab -e

              – phoops
              May 3 '14 at 22:35













            13












            13








            13







            /etc/crontab is the system wide crontab.



            The format of /etc/crontab is like this:



            # m h dom mon dow user command
            * * * * * someuser echo 'foo'


            while crontab -e is per user, it's worth mentioning with no -u argument the crontab command goes to the current users crontab. You can do crontab -e -u <username> to edit a specific users crontab.



            Notice in a per user crontab there is no 'user' field.



            # m h dom mon dow command
            * * * * * echo 'foo'


            An aspect of crontabs that may be confusing is that root also has its own crontab. e.g. crontab -e -u root will not edit /etc/crontab See Configuring cron.



            In Linux distros, per user crontabs are typically stored in: /var/spool/crontabs/<username>



            References



            https://superuser.com/questions/290093/difference-between-etc-crontab-and-crontab-e






            share|improve this answer















            /etc/crontab is the system wide crontab.



            The format of /etc/crontab is like this:



            # m h dom mon dow user command
            * * * * * someuser echo 'foo'


            while crontab -e is per user, it's worth mentioning with no -u argument the crontab command goes to the current users crontab. You can do crontab -e -u <username> to edit a specific users crontab.



            Notice in a per user crontab there is no 'user' field.



            # m h dom mon dow command
            * * * * * echo 'foo'


            An aspect of crontabs that may be confusing is that root also has its own crontab. e.g. crontab -e -u root will not edit /etc/crontab See Configuring cron.



            In Linux distros, per user crontabs are typically stored in: /var/spool/crontabs/<username>



            References



            https://superuser.com/questions/290093/difference-between-etc-crontab-and-crontab-e







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 20 '17 at 10:18









            Community

            1




            1










            answered May 3 '14 at 22:12









            RameshRamesh

            24k34105188




            24k34105188







            • 2





              As Congiruring cron says: there is usually no need to create a user crontab for root. Is that true? I mean the standard way is to edit the /etc/crontab, am I right?

              – Pei
              May 3 '14 at 22:32







            • 2





              There is no "standard" way, thus you can have both files. I usually edit root's crontab and avoit /etc/crontab just becaused I am used to crontab -e

              – phoops
              May 3 '14 at 22:35












            • 2





              As Congiruring cron says: there is usually no need to create a user crontab for root. Is that true? I mean the standard way is to edit the /etc/crontab, am I right?

              – Pei
              May 3 '14 at 22:32







            • 2





              There is no "standard" way, thus you can have both files. I usually edit root's crontab and avoit /etc/crontab just becaused I am used to crontab -e

              – phoops
              May 3 '14 at 22:35







            2




            2





            As Congiruring cron says: there is usually no need to create a user crontab for root. Is that true? I mean the standard way is to edit the /etc/crontab, am I right?

            – Pei
            May 3 '14 at 22:32






            As Congiruring cron says: there is usually no need to create a user crontab for root. Is that true? I mean the standard way is to edit the /etc/crontab, am I right?

            – Pei
            May 3 '14 at 22:32





            2




            2





            There is no "standard" way, thus you can have both files. I usually edit root's crontab and avoit /etc/crontab just becaused I am used to crontab -e

            – phoops
            May 3 '14 at 22:35





            There is no "standard" way, thus you can have both files. I usually edit root's crontab and avoit /etc/crontab just becaused I am used to crontab -e

            – phoops
            May 3 '14 at 22:35













            7














            /etc/cron.d (and its siblings cron.daily/weekly/monthly) is preferred for all system crontabs. You shouldn't need to touch /etc/crontab.



            It's essential to separate cron entries in multiple files, based on their functionality if you are planing to manage or automate things. Files under /etc/cron.d can be easily managed by packages or configuration management tools like puppet and chef. Root's crontab OTOH is practically un-maintenable by anything other than humans.



            So in short, for system stuff you can use /etc/cron.*. If there's something you would like the root user to do then use root's crontab. /etc/crontab should be left untouched and managed by a package.






            share|improve this answer





























              7














              /etc/cron.d (and its siblings cron.daily/weekly/monthly) is preferred for all system crontabs. You shouldn't need to touch /etc/crontab.



              It's essential to separate cron entries in multiple files, based on their functionality if you are planing to manage or automate things. Files under /etc/cron.d can be easily managed by packages or configuration management tools like puppet and chef. Root's crontab OTOH is practically un-maintenable by anything other than humans.



              So in short, for system stuff you can use /etc/cron.*. If there's something you would like the root user to do then use root's crontab. /etc/crontab should be left untouched and managed by a package.






              share|improve this answer



























                7












                7








                7







                /etc/cron.d (and its siblings cron.daily/weekly/monthly) is preferred for all system crontabs. You shouldn't need to touch /etc/crontab.



                It's essential to separate cron entries in multiple files, based on their functionality if you are planing to manage or automate things. Files under /etc/cron.d can be easily managed by packages or configuration management tools like puppet and chef. Root's crontab OTOH is practically un-maintenable by anything other than humans.



                So in short, for system stuff you can use /etc/cron.*. If there's something you would like the root user to do then use root's crontab. /etc/crontab should be left untouched and managed by a package.






                share|improve this answer















                /etc/cron.d (and its siblings cron.daily/weekly/monthly) is preferred for all system crontabs. You shouldn't need to touch /etc/crontab.



                It's essential to separate cron entries in multiple files, based on their functionality if you are planing to manage or automate things. Files under /etc/cron.d can be easily managed by packages or configuration management tools like puppet and chef. Root's crontab OTOH is practically un-maintenable by anything other than humans.



                So in short, for system stuff you can use /etc/cron.*. If there's something you would like the root user to do then use root's crontab. /etc/crontab should be left untouched and managed by a package.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Apr 7 at 13:46

























                answered May 3 '14 at 22:36









                V13V13

                2,877713




                2,877713



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f127732%2fsystem-crontab-or-root-crontab%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

                    Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

                    Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.