Timeline for Killing all the process of a command except first process
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 28, 2016 at 8:57 | answer | added | Sachin Patil | timeline score: 0 | |
| Jan 2, 2013 at 23:21 | comment | added | Gilles 'SO- stop being evil' | As Gert wrote, it would be easier and more useful to ensure that only one instance of the cron job is running. See Quick-and-dirty way to ensure only one instance of a shell script is running at a time | |
| Jan 2, 2013 at 23:19 | history | edited | Gilles 'SO- stop being evil' | CC BY-SA 3.0 |
deleted 10 characters in body
|
| Jan 2, 2013 at 12:14 | answer | added | Rahul Patil | timeline score: 3 | |
| Jan 2, 2013 at 12:14 | comment | added | jofel |
You do not need ps -ef | in front of pgrep/pkill.
|
|
| Jan 2, 2013 at 12:14 | comment | added | Gert van den Berg | Preventing the duplicates might be a better idea? Check if file exist with a valid PID at startup (possibly event check its name vs $0). If it is invalid or doesn't exist, create a file with the PID and run the script. Delete file when script is complete. (Finding that a file is missing is much quicker than reading its contents, checking if it is a valid PID, etc...) | |
| Jan 2, 2013 at 12:12 | answer | added | jofel | timeline score: 2 | |
| Jan 2, 2013 at 12:12 | answer | added | BitsOfNix | timeline score: 2 | |
| Jan 2, 2013 at 12:08 | comment | added | Rahul Patil |
if you post , output of pgrep then it would be easy using xargs
|
|
| Jan 2, 2013 at 11:44 | history | asked | Ankit Vashistha | CC BY-SA 3.0 |