LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   crontab (https://www.linuxquestions.org/questions/linux-newbie-8/crontab-478684/)

broadcast 08-30-2006 02:44 AM

crontab
 
Hello,
am new to linux, and am trying to configure a shell script to work twice a day at 3:15,
somehow it doesn't wor with the error says sh command not found,
what am I doing?

Code:

#crontab -e
Code:

#ur    mday    month  wday    who    command
0      3,15    *      *      *      root    /etc/periodic/McAfeeUpdate.sh

what is wrong?
and also i would appreciate if someone can lead me or through me at some to read on how to change defualt reporting email on linux box, RH, Debian or FC5 from root@localhost to be myaddress@mydomain.com

thank you

SlackDaemon 08-30-2006 03:07 AM

Your cron entry seems to be fine (assuming you mean to run the script at 3:00 am and 3:00 pm). It might be an error in your script. Could you post a head /etc/periodic/McAfeeUpdate.sh.

EDIT: err.. didn't see your command parameter correctly. Why are you specifying the root user there? Only system cron jobs can specify users. You want to enter:

0 3,15 * * * /etc/periodic/McAfeeUpdate.sh

If you want logwatch information to another email address you'll need to edit /etc/log.d/logwatch.conf. Edit the MailTo parameter to reflect your preferences. This is for RedHat and FC5.

broadcast 08-30-2006 10:06 AM

Thank you SlackDaemon, that was fast,
I appreciate your help,

below is the mcafee update script am trying to run,

[CODE][#!/bin/sh
#
# Update McAfee virus definitions

MCAFEE_DIR=/var/CommuniGate/CGPMcAfee/
UPDATE_CMD=/var/CommuniGate/CGPMcAfee/updateDatFiles
MAILER_CMD="/usr/bin/mail -s 'cron: McAfee Update Report'"
REPORT_ADR="postmaster"
/CODE]

now my crontab looks like
Code:

0      18,15    *      *      *        /etc/periodic/McAfeeUpdate.sh
regards


All times are GMT -5. The time now is 06:27 PM.