Koozali.org: home of the SME Server

Automating commands

Jack McCauley

Automating commands
« on: March 06, 2001, 11:11:24 PM »
I am trying to get a command to run only during certain hours of the day, and only on certain days of the week.  I have written a shell script that does the job I want every hour when I put the script into the /etc/cron.hourly directroy, but I have to move this file into and out of the directory manually.  Is there a way to automate this process?

Justin

Re: Automating commands
« Reply #1 on: March 06, 2001, 11:28:58 PM »
There is a scheduling service that comes natively in the RedHat dist.

Should do the trick for you.

Fran Boon

Re: Automating commands
« Reply #2 on: March 06, 2001, 11:40:37 PM »
The Unix way to do this is to edit /etc/crontab to get this kind of custom timing.

In E-Smith, this is under the e-smith templates system, so actually create a file:
/etc/e-smith/templates-custom/etc/crontab/10specialscript
With the command you want.

The expand the template using:
/sbin/e-smith/expand-templates /etc/crontab

Get the crontab syntax using 'man 5 crontab'
An example there is:
# run at 2:15pm on the first of every month
       15 14 1 * *     /usr/local/bin/specialscript

The E-Smith templates system is well-documented here:
http://www.e-smith.org/content/custom/

Good luck :)
Fran