[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: scripts running all the time?



On Sun, Feb 24, 2008 at 01:49:18PM +1100, Daniel Dalton wrote:
> On Sun, 24 Feb 2008, Raj Kiran Grandhi wrote:
> >Daniel Dalton wrote:
> >try 'man 5 crontab', that will tell you the format of the crontab file
> >For your case, I think the following line should work
> >0 7 * * * /path/to/script.sh
> 
> When would that stop? How do you make it stop at 10? but ok I'll test it.
> 
> Why doesn't this print hello world to the screen?
> Its 1 45 pm here now.
> 13:25-13:46 /home/daniel/bash-scripts/hpodder
> 
> hpodder has an echo line  in it and executes just fine.
> 

Write a script that starts the download.  Have it record the pid in
/var/run/ .  Have this script started by crontab at the appropriate
time.

Set up crontab to kill the process numbered by that pid file at the
appropriate time.

If you don't just want the process terminated, write the script to catch
whatever signal you want to send up so that it cleans up properly.  (try
the difference between SIGTERM and SIGKILL).  

Doug.


Reply to: