Crontab
Ben Beeson
beesond001 at hawaii.rr.com
Wed Jan 16 20:11:51 PST 2002
Rodney,
Do not place the file in cron.hourly etc. Instead, edit the crontab
file for the user to run the perl script as. For instance, if the perl
script is to be run by user rodney, log-in as, or 'su rodney' then edit
the crontab file by typing "crontab -e" at the shell prompt. The crontab
editor is whatever your shell editor variable is, in my case it defaults
to vi. You must use the "crontab -e" command or some other special
crontab editor such as kcrontab to keep things from getting goofed up.
Other than that, the editing is pretty straightforward.
From here you need to edit the file and save it. From there, the system
takes care of the rest. Details for how to edit the crontab file and
what the different fields mean are found at "man 5 crontab" I have pasted
a few examples from some of my system files as examples in hopes that
they help.
This is an example of a crontab run as a mere mortal user....
***********************************
# Fetch the latest GOES 10 full disk IR image and set it as wallpaper....
15 6,12,18,0 * * * wget -m
http://www.npmoc.navy.mil/satimages/goesfull.jpg 2>&1
The above script runs at 15 minutes after 6,12,18, and 0Z and runs the
wget command to fetch the satellite image. It is stored in a file I use
for the kde background.
*****************************************
Here are a few others that run as root...
# various entries via e-mail to root.
13 */6 * * * /usr/local/etc/logcheck.sh >
/dev/console 2>&1
# Send the output and stnadard error to /dev/console
0 16 * * 1-5 /usr/local/bin/NeoBlocker stop >
/dev/console 2>&1
0 18 * * 1-5 /usr/local/bin/NeoBlocker start >
/dev/console 2>&1
01 18 * * 5 /usr/local/bin/NeoBlocker stop >
/dev/console 2>&1
0 16 * * 0 /usr/local/bin/NeoBlocker start >
/dev/console 2>&1
# Run snort-stat on /var/log/secure and send results to ben
17 0-23/4 * * *
/usr/src/redhat/SOURCES/snort-stat /var/log/secure 2>&1 | /bin/mail -s
"Snort Stats " ben
# Fetch the new virus signature files from the McAfee ftp server
11 12 * * *
/usr/local/uvscan/GetMcAfeeUpdates
# Scan the home directory daily for virii. Quarantined files are in
/home/virii.
03 23 * * * /usr/local/uvscan/uvscan
--summary -c -m /home/virii -r /home --exclude /home/virii
# Full System Scan once a week....
40 03 * * 1 /usr/local/uvscan/uvscan
--summary -c -m /home/virii -r /
The first entry runs every 6 hours at 13 minutes after the hour and runs
the logcheck.sh script.
The next four entries have to do with blocking and unblocking access to
the NeoPets site at various times in an attempt to get my kids homework
distractions minimized....
The snort-stat script is run every four hours and the results are mailed
to ben...
The last few are to run a virus scanner and fetch updated signature files
automatically.
*****************************************
Hope this helps...
Ben
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 1/16/02, 6:34:22 AM, "Rodney Davis" <rodney at wincubic.com> wrote
regarding [luau] Crontab:
> If I want crontab to run a perl script every hour, do I stick the script
> in cron.hourly or do I have to append some code to the crontab file or
> crontab.master file as well? I am running Mandrake 8.1.
> Thanks,
> rodney
> ---
> You are currently subscribed to luau as: beesond001 at hawaii.rr.com
> To unsubscribe send a blank email to $subst('Email.Unsub')
More information about the LUAU
mailing list