Run Command Background After Logout Nohup & Screen

Run Command Background After Logout Nohup & Screen

 Nohup เป็นคำสั่ง Run Command Background ถึงแม้จะ Logout ไปแล้วก็ยังรันอยู่

                               nohup my program &
                               nohup ./command &
                               nohup ./command & > nohup.out

Screen เป็นคำสั่ง Run Command Single Windows และสามารถย้ายกลับมาเบื้่องหลังได้

                             1. สร้าง Task Process :

                             $ screen -S task

                            2. หลังจากรันแล้ว ถ้ายังรันไม่จบ ให้กดปุ่ม

                                $ Ctrl+a+d

                                Save Task:

                               [Task Info]

                              เสร็จแล้วให้ Exit :

                              $ exit

                              [screen is terminating]

                         3. แสดง Screen Task List :

                            $ screen -ls

                            There is a screen on:

                           10000.task (Task Info)

                       4. เรียกหน้า Screen กลับมา :

                          $ screen -r 10000

Credit http://www.52nlp.com/nohup-and-screen/
           http://www.felixgers.de/teaching/internet/nohup.html

           http://cholwich.org/wordpress/2008/08/07/screen-nohup-sighup/