Bring a cronjab back to foreground











up vote
0
down vote

favorite












I've set a cronjob to upgrade my ubuntu in /etc/crontab:



0  2    * * 1   root    apt update && apt upgrade -y >> /home/user/upgrade.txt 2>&1


Now, in ~/upgrade.txt, this line is written:




What do you want to do about modified configuration file grub?




I want it to bring it back to my shell and enter 'Y'. How can i do this?



$ ps -ef | grep apt    
root 2488 2484 0 02:00 ? 00:00:00 /bin/sh -c apt update && apt upgrade -y >> /home/user/upgrade.txt 2>&1
root 5426 2488 0 02:03 ? 00:00:30 apt upgrade -y
user 32202 28507 0 13:24 pts/8 00:00:00 grep --color=auto apt


telling that upgrade process is waiting for me to enter "Y" or "N", but I don't know how to bring it to my terminal. Does anyone have any idea?










share|improve this question




























    up vote
    0
    down vote

    favorite












    I've set a cronjob to upgrade my ubuntu in /etc/crontab:



    0  2    * * 1   root    apt update && apt upgrade -y >> /home/user/upgrade.txt 2>&1


    Now, in ~/upgrade.txt, this line is written:




    What do you want to do about modified configuration file grub?




    I want it to bring it back to my shell and enter 'Y'. How can i do this?



    $ ps -ef | grep apt    
    root 2488 2484 0 02:00 ? 00:00:00 /bin/sh -c apt update && apt upgrade -y >> /home/user/upgrade.txt 2>&1
    root 5426 2488 0 02:03 ? 00:00:30 apt upgrade -y
    user 32202 28507 0 13:24 pts/8 00:00:00 grep --color=auto apt


    telling that upgrade process is waiting for me to enter "Y" or "N", but I don't know how to bring it to my terminal. Does anyone have any idea?










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I've set a cronjob to upgrade my ubuntu in /etc/crontab:



      0  2    * * 1   root    apt update && apt upgrade -y >> /home/user/upgrade.txt 2>&1


      Now, in ~/upgrade.txt, this line is written:




      What do you want to do about modified configuration file grub?




      I want it to bring it back to my shell and enter 'Y'. How can i do this?



      $ ps -ef | grep apt    
      root 2488 2484 0 02:00 ? 00:00:00 /bin/sh -c apt update && apt upgrade -y >> /home/user/upgrade.txt 2>&1
      root 5426 2488 0 02:03 ? 00:00:30 apt upgrade -y
      user 32202 28507 0 13:24 pts/8 00:00:00 grep --color=auto apt


      telling that upgrade process is waiting for me to enter "Y" or "N", but I don't know how to bring it to my terminal. Does anyone have any idea?










      share|improve this question















      I've set a cronjob to upgrade my ubuntu in /etc/crontab:



      0  2    * * 1   root    apt update && apt upgrade -y >> /home/user/upgrade.txt 2>&1


      Now, in ~/upgrade.txt, this line is written:




      What do you want to do about modified configuration file grub?




      I want it to bring it back to my shell and enter 'Y'. How can i do this?



      $ ps -ef | grep apt    
      root 2488 2484 0 02:00 ? 00:00:00 /bin/sh -c apt update && apt upgrade -y >> /home/user/upgrade.txt 2>&1
      root 5426 2488 0 02:03 ? 00:00:30 apt upgrade -y
      user 32202 28507 0 13:24 pts/8 00:00:00 grep --color=auto apt


      telling that upgrade process is waiting for me to enter "Y" or "N", but I don't know how to bring it to my terminal. Does anyone have any idea?







      command-line cron






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 26 at 10:28









      muru

      135k19286485




      135k19286485










      asked Nov 26 at 9:59









      Mohammad Kholghi

      235




      235






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          The short answer: You can't.



          You will have to kill the running processes and run them manually from the terminal as:



          sudo apt update && sudo apt upgrade -y


          or without sudo if you already are root.






          share|improve this answer






























            up vote
            0
            down vote













            You can try to use reptyr (also in ubuntu repos):
            https://github.com/nelhage/reptyr



            via
            reptyr PID (which you already have)






            share|improve this answer





















            • Couldn't help me with this problem, but thanks for sharing this perfect program:)
              – Mohammad Kholghi
              Nov 26 at 10:23











            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            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: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            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%2faskubuntu.com%2fquestions%2f1096120%2fbring-a-cronjab-back-to-foreground%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








            up vote
            1
            down vote



            accepted










            The short answer: You can't.



            You will have to kill the running processes and run them manually from the terminal as:



            sudo apt update && sudo apt upgrade -y


            or without sudo if you already are root.






            share|improve this answer



























              up vote
              1
              down vote



              accepted










              The short answer: You can't.



              You will have to kill the running processes and run them manually from the terminal as:



              sudo apt update && sudo apt upgrade -y


              or without sudo if you already are root.






              share|improve this answer

























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                The short answer: You can't.



                You will have to kill the running processes and run them manually from the terminal as:



                sudo apt update && sudo apt upgrade -y


                or without sudo if you already are root.






                share|improve this answer














                The short answer: You can't.



                You will have to kill the running processes and run them manually from the terminal as:



                sudo apt update && sudo apt upgrade -y


                or without sudo if you already are root.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 26 at 14:18









                waltinator

                21.7k74169




                21.7k74169










                answered Nov 26 at 10:08









                Soren A

                3,2781824




                3,2781824
























                    up vote
                    0
                    down vote













                    You can try to use reptyr (also in ubuntu repos):
                    https://github.com/nelhage/reptyr



                    via
                    reptyr PID (which you already have)






                    share|improve this answer





















                    • Couldn't help me with this problem, but thanks for sharing this perfect program:)
                      – Mohammad Kholghi
                      Nov 26 at 10:23















                    up vote
                    0
                    down vote













                    You can try to use reptyr (also in ubuntu repos):
                    https://github.com/nelhage/reptyr



                    via
                    reptyr PID (which you already have)






                    share|improve this answer





















                    • Couldn't help me with this problem, but thanks for sharing this perfect program:)
                      – Mohammad Kholghi
                      Nov 26 at 10:23













                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    You can try to use reptyr (also in ubuntu repos):
                    https://github.com/nelhage/reptyr



                    via
                    reptyr PID (which you already have)






                    share|improve this answer












                    You can try to use reptyr (also in ubuntu repos):
                    https://github.com/nelhage/reptyr



                    via
                    reptyr PID (which you already have)







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 26 at 10:07









                    janmyszkier

                    50827




                    50827












                    • Couldn't help me with this problem, but thanks for sharing this perfect program:)
                      – Mohammad Kholghi
                      Nov 26 at 10:23


















                    • Couldn't help me with this problem, but thanks for sharing this perfect program:)
                      – Mohammad Kholghi
                      Nov 26 at 10:23
















                    Couldn't help me with this problem, but thanks for sharing this perfect program:)
                    – Mohammad Kholghi
                    Nov 26 at 10:23




                    Couldn't help me with this problem, but thanks for sharing this perfect program:)
                    – Mohammad Kholghi
                    Nov 26 at 10:23


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • 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%2faskubuntu.com%2fquestions%2f1096120%2fbring-a-cronjab-back-to-foreground%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

                    Ellipse (mathématiques)

                    Quarter-circle Tiles

                    Mont Emei