Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-06-2004, 09:29 PM   #1
LQ Newbie
Registered: Nov 2002
Location: LA, CA
Distribution: Red Hat 7.3 and 8
Posts: 5

Rep: Reputation: 0
Can't Cron with Redhat


I've been trying to get a cron job to send /var/log/ messages to my email address.

The cron job is this:


# Email /var/log/messages to my email



mail -s "LOG for $FN" $ADMIN < /var/log/messages


The error message is this:
/bin/bash: line 1: root: command not found.

The error does not seem to be from the crontab. This is the first cronjob I have attempted and I'm a newbie, so any help would be appreciated. My OS is Redhat Enterprise WS. Also- Is there another file that goes in the cron.hourly folder? I only have the cron file in the cron.hourly folder.

Help! Thanks!
Old 09-06-2004, 09:46 PM   #2
Senior Member
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
have you tried giving the full path for mail, for example

/bin/mail -s "LOG for $FN" $ADMIN < /var/log/messages
Old 09-08-2004, 12:00 AM   #3
LQ Newbie
Registered: Nov 2002
Location: LA, CA
Distribution: Red Hat 7.3 and 8
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for the tip, it didn't work but I was able to fixed the issue.

I was getting an error in /var/log/messages , therefore I removed and recreated the /etc/crontab . I don't know if the crontab: /var/spool/cron/root caused problems, but I removed it as well.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
cron.allow and cron.deny in slackware? tl64 Slackware 5 10-13-2005 09:44 PM
No More Cron Mail, Cron Error? Xhost Linux - General 3 07-26-2004 04:28 PM
[cron][mdk9.1]cron deamon seems to ignore some task... yannrichet Linux - Newbie 5 06-26-2003 09:57 AM
dual entries in cron log for cron.daily cpharvey Linux - General 3 02-27-2003 02:30 PM > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration