Task Scheduling

Corey Edwards tensai at zmonkey.org
Wed Jan 25 11:01:06 MST 2006

On Wed, 2006-01-25 at 10:54 -0700, Ryan Bowman wrote:
> At work we use jboss as our web app server, when we want to deploy new
> code we need to restart jboss, but the optimal time to do so is
> between 1am and 3am. Rather than wake up that early I want to schedule
> the restart to happen automatically, but it doesn't need to happen on
> a regular schedule, just every so often when we have new code to
> launch.
> I'm thinking of writing a script that edits crontab to schedule the
> restart for 1am daily.  I can run that script manually on the days
> that I need to restart jboss, then the following day remove that task
> from cron (or modify the restart script to edit crontab for me).  Is
> there a better way?

Have the script run every night but check for the existence of a file
(say, /etc/jboss.restart). If the file exists, continue and remove the
file when done. Otherwise, simply exit.

        if [ -e /etc/jboss.restart ];
          do real restart
          rm /etc/jboss.restart


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://plug.org/pipermail/plug/attachments/20060125/bcd410e6/attachment.bin 

More information about the PLUG mailing list