Does a job scheduled in crontab run even when I log out?












9














I add some job in crontab file on a server.




  • When I log out and the server is still on, will the job still run?


  • Does it matter if I create a screen or tmux session and run some shell in it and detach it before log out?











share|improve this question



























    9














    I add some job in crontab file on a server.




    • When I log out and the server is still on, will the job still run?


    • Does it matter if I create a screen or tmux session and run some shell in it and detach it before log out?











    share|improve this question

























      9












      9








      9


      1





      I add some job in crontab file on a server.




      • When I log out and the server is still on, will the job still run?


      • Does it matter if I create a screen or tmux session and run some shell in it and detach it before log out?











      share|improve this question













      I add some job in crontab file on a server.




      • When I log out and the server is still on, will the job still run?


      • Does it matter if I create a screen or tmux session and run some shell in it and detach it before log out?








      cron






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 21 '15 at 13:03









      TimTim

      26.3k74246455




      26.3k74246455






















          2 Answers
          2






          active

          oldest

          votes


















          17














          cron is a process which deals with scheduled tasks whether you are logged in or not. It is not necessary to have a screen or tmux session running since the cron daemon will execute the scheduled tasks in separate shells.



          See man cron and man crontab for details.






          share|improve this answer























          • when I log out, which user will run and own the job scheduled in crontab? If it is not me, can that cause some potential problem?
            – Tim
            Apr 21 '15 at 13:08












          • That depends on which crontab you edited. If you edit the crontab of a user the entries are executed as that user. If you edited the /etc/crontab file the user is often specified between the interval and the command like: "17 * * * * root cd / && run-parts --report /etc/cron.hourly". Besides it does also depend on the platform you are using. Ubuntu uses a different cron than for instance Solaris
            – Lambert
            Apr 21 '15 at 13:14










          • I use ubuntu. What is "the crontab of a user"? In "the crontab of a user", can I also specify which user will run a scheduled job?
            – Tim
            Apr 21 '15 at 13:26












          • Ubuntu cron has some explanation text in the crontab files. As a user perform crontab -e to read about the user crontab file and cat /etc/crontab to read about the server-wide crontab file. From a user crontab file you can not run commands using a different user although it is possible to use sudo if passwordless commands are specified
            – Lambert
            Apr 21 '15 at 13:33










          • Thanks. /etc/crontab is for system-wide, then where is the crontab file for a user?
            – Tim
            Apr 21 '15 at 19:42





















          0














          The crontab file for a user is edited by running 'crontab -e'.






          share|improve this answer








          New contributor




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


















            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%2f197615%2fdoes-a-job-scheduled-in-crontab-run-even-when-i-log-out%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









            17














            cron is a process which deals with scheduled tasks whether you are logged in or not. It is not necessary to have a screen or tmux session running since the cron daemon will execute the scheduled tasks in separate shells.



            See man cron and man crontab for details.






            share|improve this answer























            • when I log out, which user will run and own the job scheduled in crontab? If it is not me, can that cause some potential problem?
              – Tim
              Apr 21 '15 at 13:08












            • That depends on which crontab you edited. If you edit the crontab of a user the entries are executed as that user. If you edited the /etc/crontab file the user is often specified between the interval and the command like: "17 * * * * root cd / && run-parts --report /etc/cron.hourly". Besides it does also depend on the platform you are using. Ubuntu uses a different cron than for instance Solaris
              – Lambert
              Apr 21 '15 at 13:14










            • I use ubuntu. What is "the crontab of a user"? In "the crontab of a user", can I also specify which user will run a scheduled job?
              – Tim
              Apr 21 '15 at 13:26












            • Ubuntu cron has some explanation text in the crontab files. As a user perform crontab -e to read about the user crontab file and cat /etc/crontab to read about the server-wide crontab file. From a user crontab file you can not run commands using a different user although it is possible to use sudo if passwordless commands are specified
              – Lambert
              Apr 21 '15 at 13:33










            • Thanks. /etc/crontab is for system-wide, then where is the crontab file for a user?
              – Tim
              Apr 21 '15 at 19:42


















            17














            cron is a process which deals with scheduled tasks whether you are logged in or not. It is not necessary to have a screen or tmux session running since the cron daemon will execute the scheduled tasks in separate shells.



            See man cron and man crontab for details.






            share|improve this answer























            • when I log out, which user will run and own the job scheduled in crontab? If it is not me, can that cause some potential problem?
              – Tim
              Apr 21 '15 at 13:08












            • That depends on which crontab you edited. If you edit the crontab of a user the entries are executed as that user. If you edited the /etc/crontab file the user is often specified between the interval and the command like: "17 * * * * root cd / && run-parts --report /etc/cron.hourly". Besides it does also depend on the platform you are using. Ubuntu uses a different cron than for instance Solaris
              – Lambert
              Apr 21 '15 at 13:14










            • I use ubuntu. What is "the crontab of a user"? In "the crontab of a user", can I also specify which user will run a scheduled job?
              – Tim
              Apr 21 '15 at 13:26












            • Ubuntu cron has some explanation text in the crontab files. As a user perform crontab -e to read about the user crontab file and cat /etc/crontab to read about the server-wide crontab file. From a user crontab file you can not run commands using a different user although it is possible to use sudo if passwordless commands are specified
              – Lambert
              Apr 21 '15 at 13:33










            • Thanks. /etc/crontab is for system-wide, then where is the crontab file for a user?
              – Tim
              Apr 21 '15 at 19:42
















            17












            17








            17






            cron is a process which deals with scheduled tasks whether you are logged in or not. It is not necessary to have a screen or tmux session running since the cron daemon will execute the scheduled tasks in separate shells.



            See man cron and man crontab for details.






            share|improve this answer














            cron is a process which deals with scheduled tasks whether you are logged in or not. It is not necessary to have a screen or tmux session running since the cron daemon will execute the scheduled tasks in separate shells.



            See man cron and man crontab for details.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 11 '18 at 11:52









            Jeff Schaller

            39k1053125




            39k1053125










            answered Apr 21 '15 at 13:07









            LambertLambert

            8,85721128




            8,85721128












            • when I log out, which user will run and own the job scheduled in crontab? If it is not me, can that cause some potential problem?
              – Tim
              Apr 21 '15 at 13:08












            • That depends on which crontab you edited. If you edit the crontab of a user the entries are executed as that user. If you edited the /etc/crontab file the user is often specified between the interval and the command like: "17 * * * * root cd / && run-parts --report /etc/cron.hourly". Besides it does also depend on the platform you are using. Ubuntu uses a different cron than for instance Solaris
              – Lambert
              Apr 21 '15 at 13:14










            • I use ubuntu. What is "the crontab of a user"? In "the crontab of a user", can I also specify which user will run a scheduled job?
              – Tim
              Apr 21 '15 at 13:26












            • Ubuntu cron has some explanation text in the crontab files. As a user perform crontab -e to read about the user crontab file and cat /etc/crontab to read about the server-wide crontab file. From a user crontab file you can not run commands using a different user although it is possible to use sudo if passwordless commands are specified
              – Lambert
              Apr 21 '15 at 13:33










            • Thanks. /etc/crontab is for system-wide, then where is the crontab file for a user?
              – Tim
              Apr 21 '15 at 19:42




















            • when I log out, which user will run and own the job scheduled in crontab? If it is not me, can that cause some potential problem?
              – Tim
              Apr 21 '15 at 13:08












            • That depends on which crontab you edited. If you edit the crontab of a user the entries are executed as that user. If you edited the /etc/crontab file the user is often specified between the interval and the command like: "17 * * * * root cd / && run-parts --report /etc/cron.hourly". Besides it does also depend on the platform you are using. Ubuntu uses a different cron than for instance Solaris
              – Lambert
              Apr 21 '15 at 13:14










            • I use ubuntu. What is "the crontab of a user"? In "the crontab of a user", can I also specify which user will run a scheduled job?
              – Tim
              Apr 21 '15 at 13:26












            • Ubuntu cron has some explanation text in the crontab files. As a user perform crontab -e to read about the user crontab file and cat /etc/crontab to read about the server-wide crontab file. From a user crontab file you can not run commands using a different user although it is possible to use sudo if passwordless commands are specified
              – Lambert
              Apr 21 '15 at 13:33










            • Thanks. /etc/crontab is for system-wide, then where is the crontab file for a user?
              – Tim
              Apr 21 '15 at 19:42


















            when I log out, which user will run and own the job scheduled in crontab? If it is not me, can that cause some potential problem?
            – Tim
            Apr 21 '15 at 13:08






            when I log out, which user will run and own the job scheduled in crontab? If it is not me, can that cause some potential problem?
            – Tim
            Apr 21 '15 at 13:08














            That depends on which crontab you edited. If you edit the crontab of a user the entries are executed as that user. If you edited the /etc/crontab file the user is often specified between the interval and the command like: "17 * * * * root cd / && run-parts --report /etc/cron.hourly". Besides it does also depend on the platform you are using. Ubuntu uses a different cron than for instance Solaris
            – Lambert
            Apr 21 '15 at 13:14




            That depends on which crontab you edited. If you edit the crontab of a user the entries are executed as that user. If you edited the /etc/crontab file the user is often specified between the interval and the command like: "17 * * * * root cd / && run-parts --report /etc/cron.hourly". Besides it does also depend on the platform you are using. Ubuntu uses a different cron than for instance Solaris
            – Lambert
            Apr 21 '15 at 13:14












            I use ubuntu. What is "the crontab of a user"? In "the crontab of a user", can I also specify which user will run a scheduled job?
            – Tim
            Apr 21 '15 at 13:26






            I use ubuntu. What is "the crontab of a user"? In "the crontab of a user", can I also specify which user will run a scheduled job?
            – Tim
            Apr 21 '15 at 13:26














            Ubuntu cron has some explanation text in the crontab files. As a user perform crontab -e to read about the user crontab file and cat /etc/crontab to read about the server-wide crontab file. From a user crontab file you can not run commands using a different user although it is possible to use sudo if passwordless commands are specified
            – Lambert
            Apr 21 '15 at 13:33




            Ubuntu cron has some explanation text in the crontab files. As a user perform crontab -e to read about the user crontab file and cat /etc/crontab to read about the server-wide crontab file. From a user crontab file you can not run commands using a different user although it is possible to use sudo if passwordless commands are specified
            – Lambert
            Apr 21 '15 at 13:33












            Thanks. /etc/crontab is for system-wide, then where is the crontab file for a user?
            – Tim
            Apr 21 '15 at 19:42






            Thanks. /etc/crontab is for system-wide, then where is the crontab file for a user?
            – Tim
            Apr 21 '15 at 19:42















            0














            The crontab file for a user is edited by running 'crontab -e'.






            share|improve this answer








            New contributor




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























              0














              The crontab file for a user is edited by running 'crontab -e'.






              share|improve this answer








              New contributor




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





















                0












                0








                0






                The crontab file for a user is edited by running 'crontab -e'.






                share|improve this answer








                New contributor




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









                The crontab file for a user is edited by running 'crontab -e'.







                share|improve this answer








                New contributor




                Brian H. 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






                New contributor




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









                answered 13 mins ago









                Brian H.Brian H.

                1




                1




                New contributor




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





                New contributor





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






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






























                    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.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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%2f197615%2fdoes-a-job-scheduled-in-crontab-run-even-when-i-log-out%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

                    CARDNET

                    Boot-repair Failure: Unable to locate package grub-common:i386

                    濃尾地震