ไม่ได้ใช้คำสั่งนี้นานๆ ลืมได้เหมือนกัน ทั้งที่เป็นคำสั่งง่ายๆ เลยเขียน blog นี้ลงโทษตัวเองที่ลืม
เคยไหม เวลาเข้า ssh แล้วต้องรัน scripts ซึ่งต้องใช้เวลานานๆ แต่เน็ตดันหลุด (และมักจะหลุดตอนมีเหตุสำคัญ...)
Linux มีคำสั่ง run command เป็นแบบ background process ดังนี้
$command &
ถ้าหากเรา remote ด้วย SSH, Telnet แล้วใช้คำสั่งนี้ เวลาเราออกจาก ssh/telnet ไม่ว่าจะเน็ตหลุดหรือไม่ตั้งใจก็ตาม
คำสั่งที่ทำงานอยู่จะถูก kill process ไปด้วย
ดังนั้น Linux จึงมีคำสั่ง nohup ใช้งานดังนี้
$nohup command &
note:
keyword: Linux, long, background, process
เคยไหม เวลาเข้า ssh แล้วต้องรัน scripts ซึ่งต้องใช้เวลานานๆ แต่เน็ตดันหลุด (และมักจะหลุดตอนมีเหตุสำคัญ...)
Linux มีคำสั่ง run command เป็นแบบ background process ดังนี้
$command &
ถ้าหากเรา remote ด้วย SSH, Telnet แล้วใช้คำสั่งนี้ เวลาเราออกจาก ssh/telnet ไม่ว่าจะเน็ตหลุดหรือไม่ตั้งใจก็ตาม
คำสั่งที่ทำงานอยู่จะถูก kill process ไปด้วย
ดังนั้น Linux จึงมีคำสั่ง nohup ใช้งานดังนี้
$nohup command &
note:
- HUP ย่อมาจาก hangup (signal)
- no hup คือ การไม่ส่ง hangup signal ไปยัง kernel
- ไม่จำเป็นต้องใช้ nohup กับ wget เนื่องจาก wget มี wget -b อยู่แล้ว
keyword: Linux, long, background, process
0 Comments On This Entry
← September 2010 →
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 |
Search My Blog
Recent Entries
-
-
การดึง contact จาก ผู้ให้บริการเวบเมล (yahoo, hotmail, gmail,...)on Jan 22 2010 10:26 AM
-
-
-
My Blog Links
Recent Comments
Tags
test
test
Help
Leave Comment








