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

Re: Unidentified subject!



Gerry Jensen <gerry@blue.intele.net> writes:
> Does anyone know of an easy way to make it so that 
> cron.daily/weekly/monthly jobs get executed even if the system is not on 
> at the specified time?
> 
> For instance, I typically only run my home system an hour or two per 
> day.  How could I make it so that the first time I boot my system each 
> day, /etc/cron.daily jobs gets run, the first time I boot each week that 
> /etc/cron.weekly gets run, and the first time I boot at the beginning of 
> a new month that /etc/cron.monthly gets run?  As it is now, these almost 
> never get run unless I do it manually.

  It shouldn't be too difficult to write some perl that reads
  /var/something that contains three numbers (output of time()): the
  last time a daily was run, the last time a weekly was run, and the
  last time a monthly was run.  If the current time is greater than a
  day past the last daily, the daily script is run and the daily time
  is updated, and--you get the idea.

  You'd call this script from /etc/rc.local.

  p.s. your electronics and disks would be happier to run around the
  clock.  The power surges and temperature differentials from turning
  the machine on and off are rather hard on the equipment.

Bill Wohler <wohler@newt.com>   ph: +1-415-854-1857  fax: +1-415-854-3195
Say it with MIME.  Maintainer of comp.mail.mh and news.software.nn FAQs.
If you're passed on the right, you're in the wrong lane.


Reply to: