code_junkie

How to kill a linux process by STIME (dangling svnserve processes)

Nov 12th, 2011
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. ps -fu cvsuser
  2.  
  3. kill where STIME = Oct30
  4.  
  5. ps h -u cvsuser -o pid,start # h - no header, only output pid and start
  6. | grep -v ':' # exclude entries from the last 24 hours
  7. | egrep -o '^ *[0-9]+' # get the pid (handling possible leading space)
  8. | xargs -i echo kill "{}" # pretend to kill - take out the echo if you're happy
  9.  
  10. ps h -u csvuser -o pid,lstart | grep 'May 29' | sed 's/^ +//' |
  11. cut -d ' ' -f 1 | xargs -n 1 kill
  12.  
  13. 16324 Thu May 29 04:02:06 2008
  14. 22144 Tue Jul 22 04:02:05 2008
  15. 11315 Wed Oct 8 04:02:00 2008
  16.  
  17. 16324 Thu May 29 04:02:06 2008
  18.  
  19. 16324
Add Comment
Please, Sign In to add comment