[lug] Crontab

Michael J. Hammel mjhammel at graphics-muse.org
Fri Jun 22 10:03:28 MDT 2001


Thus spoke Carlos =?iso-8859-1?Q?Hern=E1ndez=20L=F3pez?=
> For some aplication,  I need to execute several bash scripts
> periodically during a specific lapse of time. Crontab would be perfect,
> however the minimum period of time that you can specify is 1 minute,
> and  I need to execute the scripts maybe every 15 seconds.
> 
> Obviously  I can manage in order that the scripts "knows" when to
> execute but I don't want to reinvent the wheel and something  similar to
> contab would be nicer.

There are lots of solutions to this.  A simple bash or perl script launcher that
runs a timer is one solution.  A GTK app that opens no windows and sets a
timer is another.  Essentially, you just need some API that provides a
timer function with granularity of 1 second.  Most programming languages
available for Linux provide such timers.

Note that on a non-networked system this is a no-brainer to implement.  But
on a networked system you have to worry about someone replacing your shell
scripts that the launcher is going to run.  Simple security checks such as
making sure only the owner of the launcher can write to the scripts or
checksum checks can be used in this case.
-- 
Michael J. Hammel                               The Graphics Muse 
mjhammel at graphics-muse.org                      http://www.graphics-muse.com
------------------------------------------------------------------------------
It's hard to believe that he beat 1,000,000 other sperm to the egg.
-- From a real employee performance evaluation.



More information about the LUG mailing list