It is currently Tue, 17 May 2022 18:51:30 GMT



 
Author Message
 starting a process when other die... and crontab
Hi,

I'm downloading, preprocessing, and indexing some newspapers;

I have a crontab like this:

#nation-wide
58 2 * * 0-6 /scripts/DownloadNewspapers.pl www.nytimes.com

#preprocessing  stuff here
*****
#indexing stuff here
*****

I need  the preprocessing process starting ONLY when the download process
has ended. I can use top to see is DownloadNewspapers.pl
is still alive or not, but this imply to create a script that is only
'hearing' processes... and has to be working the whole day, like a daemon.

Does anybody have a better, more elegant solution? (I'm sure that there must
be a Unix trick to do that...)

Thanks in advance,

Jose



 Tue, 03 Jun 2003 12:04:11 GMT   
 starting a process when other die... and crontab
How about doing

  58 2 * * * /scripts/DownloadNewspapers.pl www.nytimes.com; preprocess_cmd

For day of the week field, * == 0-6

---Robert

_________________________

 >
 > Hi,
 >
 > I'm downloading, preprocessing, and indexing some newspapers;
 >
 > I have a crontab like this:
 >
 > #nation-wide
 > 58 2 * * 0-6 /scripts/DownloadNewspapers.pl www.nytimes.com
 >
 > #preprocessing  stuff here
 > *****
 > #indexing stuff here
 > *****
 >
 > I need  the preprocessing process starting ONLY when the download process
 > has ended. I can use top to see is DownloadNewspapers.pl
 > is still alive or not, but this imply to create a script that is only
 > 'hearing' processes... and has to be working the whole day, like a daemon.
 >
 > Does anybody have a better, more elegant solution? (I'm sure that there must
 > be a Unix trick to do that...)
 >
 > Thanks in advance,
 >
 > Jose



 Tue, 03 Jun 2003 13:23:24 GMT   
 starting a process when other die... and crontab

Aha, it would work if DownloadNewspapers.pl only return the control to the
system when finished;
But it is calling wget (a spider) as background process.
So, DownloadNewspapers.pl is done, but wget is still working in the
background...
You can monitor wget with top (not with ps) , and start preprocessing
when wget is done (but I don't know exactly how to get changing information
from top and handle it with a script that do that )
moreover, There is 6 simultaneous processes 'wget', one for each newspaper.

-Jose

news:3A39AACC.CB859074@alf.dec.com...



 Tue, 03 Jun 2003 16:13:49 GMT   
 
   [ 3 post ] 

Similar Threads

1. Root process won't start correctly form crontab in AIX 4.3.3

2. Root process won't start correctly form crontab in AIX 4.3.3

3. Help: Keeping several processes in sync - one dies they all die

4. background process persist-or-die when its parent shell dies

5. child processes not dying with parent process??

6. Process Id for the child process that is dying

7. Process start when host start

8. Running Processes After Others Finish

9. How to allow others to kill processes

10. Starting a remote process w/o a local process


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software