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.
#!/bin/sh
if [ -e /etc/jboss.restart ];
then
do real restart
rm /etc/jboss.restart
fi
Corey
signature.asc
Description: This is a digitally signed message part
/* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
