I need a script that will murder java processes that have been on for more than one hour.
So I am trying this
timeout -k 10s nohup cpulimit -l 40 -- java -jar file.jar
Any idea why this isn't working?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityYou should have the nohup
first, then timeout
. nohup
's disassociation with the controlling terminal breaks the ownership relationship that timeout
uses to kill.
Also 10s
tells timeout
"Ten Seconds", not "One Hour".