|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
|
Re: [PLUG] seconds in cron
|
>
> #!/bin/sh
> do_it & # runs at time 0
> sleep 45
> do_it & # runs at time :45
> sleep 45
> do_it & # runs at time 1:30
> sleep 45
> do_it & # runs at time 2:15
>
> Have cron run this every three minutes.
>
> Note, though, that cron does not guarantee fine-grain scheduling, so
> you might be off a bit. But it's close.
>
> Why 45 seconds?
Because the client wants it this way!
The shell script option is there - but I'd like to do it with cron,
that's what they want - and - isn't it more efficient ?
>
>
> Alternatively, have cron check every few minutes that the following
> shell script is still running, and if not relaunch it:
>
> #!/bin/sh
> while true; do do_it &; sleep 45; done
>
>
> In all of the above you can get rid of the ampersands if the run time
> for do_it is not a concern.
>
>
--
Life's about freedom - so is Linux.
Sandhitsu Ranjan Das Voice: 215-849-7390(R)
Graduate Student, Bioengineering 215-898-0822(O)
University of Pennsylvania e-mail: sudas@seas.upenn.edu
snail mail:3320 Smith Walk, 120 Hayden Hall, Philadelphia, PA 19104
______________________________________________________________________
Philadelphia Linux Users Group - http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion - http://lists.phillylinux.org/mail/listinfo/plug
|
|