I have several running processes which is started by a shell, but I don't want them to run during 08:00am - 20:00pm for each day because they are really bandwidth-consuming, so , I have to suspend them during that period of time instead of killing them directly because killing them will cause some problems.So , my work ,is to suspending them at 08:00am and waking them up at 20:00pm every day.Anyone can tell my how to do that ? I tried to do this in crontab, I use kill -19 pid to suspend them but I don't know how to wake them up by pid number.

Maybe a shell script will be quite appreciated.Thank you.


You can use word notation for more readability :

kill -STOP <PID> # pause
kill -CONT <PID> # continue working


man 7 signal

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.