Click to See Complete Forum and Search --> : shell script using /etc/cron.hourly to execute cron.php file?


rioguia
10-25-2002, 04:28 AM
I have a website I am hosting on my local server. It has some statistics functions that need to be updated. I want to use the /etc/cron.hourly file for this purpose.

The website file that does this is called /opt/ezpublish/sites/default/cron.php.

The redhat FAQ says, "All the sysadmin needs to do is drop a shell script or a link to an executable in one of the directories [referring to /etc/cron.hourly] and it will automatically be run at the appropriate time." Can anyone point me to a resource that would help me write this file?

mrBen
10-25-2002, 05:05 AM
Did a quick Google for crontab how-to and got this link (http://www2.defcon1.org/html/Software_Articles/Learning-CHMOD/Kernel-Problems/Bootup/crontab.html) which is for BSD, but seems right to me.

HTH

z0mbix
10-25-2002, 05:12 AM
This will sort you out:

http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/custom-guide/ch-autotasks.html#S1-AUTOTASKS-CRON

As you can see from the /etc/crontab file, it uses the run-parts script to execute the scripts in the /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly directories on an hourly, daily, weekly, or monthly basis respectively. The files in these directory should be shell scripts.

A basic shell script:


#!/bin/sh

command
another command
one more command
some other commands and stuff

# End