LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-07-2004, 02:03 AM   #1
merlin23
Member
 
Registered: Dec 2004
Location: Vienna
Posts: 46

Rep: Reputation: 15
suspend running processes with crontab


is it possible to stop a process that I started with crontab in the evening, in the morning ?

afterwards I also wnat to restart the sleeping process the next evening...

Last edited by merlin23; 12-07-2004 at 02:05 AM.
 
Old 12-07-2004, 03:09 AM   #2
merlin23
Member
 
Registered: Dec 2004
Location: Vienna
Posts: 46

Original Poster
Rep: Reputation: 15
the easiest solution I found is to find out the pid of the processes and then add following entries:

0 20 * * * kill -CONT pid
30 6 * * * kill -STOP pid

that seems to work very fine...

but what, if I don't know the pid exactly, because the parent process opens child-processes, closes them and opens other ones with other pids?

Maybe it would be possible to write a shell script, that makes a "ps -aux | grep myapp" and extracts the pid?

Also I don't want to start a job while the other one still is working...
maybe a second shell script, that looks if there is any process in "ps -aux | grep myapp"?

Hmm..seems to be difficult...

Has anyone some ideas what would be the best way to manage this problem for this case?
I've never wrote a shell-script before...

Last edited by merlin23; 12-07-2004 at 03:11 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to include x server when running crontab buffalokml Linux - General 2 11-08-2005 10:58 AM
crontab jobs aren't running mdm_linux Linux - General 4 05-30-2005 12:27 PM
Running ssh from crontab cmfarley19 Linux - Software 1 01-23-2004 08:24 AM
Zaurus running OZ having suspend issues Slebine Linux - Laptop and Netbook 3 01-05-2004 05:24 PM
Old Crontab still Running vwaldoguy Linux - Software 3 08-05-2003 02:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration