Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Quick cron question [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
lordfirebird
n00b
n00b


Joined: 24 May 2004
Posts: 43

PostPosted: Thu May 12, 2005 4:20 am    Post subject: Quick cron question [solved] Reply with quote

This may be answered somewhere already... but the nature of the question doesn't lend itself well to searching... anyway, it's probably a really simple "problem" and I'm sure I may get flack for wasting time asking ;)

But, I recently got my internal e-mail working on this machine, and I suddenly noticed that cron is very regularly complaining. (I'm using vixie-cron-4.1-r7) And that the complaints are coming from the root cron jobs. The messages I get are, once every ten minutes:
Code:

Subject: Cron <root@RhineMaiden> root    test -x /usr/sbin/run-crons && /usr/sbin/run-crons
/bin/bash: line 1: root: command not found

And once an hour:
Code:

Subject: Cron <root@RhineMaiden> root    rm -f /var/spool/cron/lastrun/cron.hourly
/bin/bash: line 1: root: command not found


Which, of course, their once an hour and once every ten minute schedules make sense since my crontab for root look like this:

Code:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/etc/crontab installed on Wed Apr  6 01:47:21 2005)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
# for vixie cron
#
# $Header: /var/cvsroot/gentoo-x86/sys-apps/vixie-cron/files/crontab-3.0.1-r4,v1.6 2004/07/18 04:40:50 dragonheart Exp $
#
#

# Global variables
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
0  *  * * *     root    rm -f /var/spool/cron/lastrun/cron.hourly
1  3  * * *     root    rm -f /var/spool/cron/lastrun/cron.daily
15 4  * * 6     root    rm -f /var/spool/cron/lastrun/cron.weekly
30 5  1 * *     root    rm -f /var/spool/cron/lastrun/cron.monthly
*/10  *  * * *  root    test -x /usr/sbin/run-crons && /usr/sbin/run-crons



My question is simply... should I worry about this? Would it be okay to set up a filter so I don't build up lots and lots of messages in the in box or is this something I should take care of? I tried just manually running /usr/sbin/run-crons and it returned a 0 status code so I don't really know if the problem lies in that. Anyway, thanks for anyone's help! I haven't had a lot of experience with cron yet so it would be nice an insight that could be provided.


Last edited by lordfirebird on Thu May 12, 2005 7:34 am; edited 1 time in total
Back to top
View user's profile Send private message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Thu May 12, 2005 5:47 am    Post subject: Reply with quote

lordfirebird,

Why do you have root between the time designation and the commands, i.e.
Code:
0  *  * * *     root (<-- this root here?)   rm -f /var/spool/cron/lastrun/cron.hourly


It seems to me that cron is complaining about not finding the command root. You should remove those from crontab, to be instead
Code:
0  *  * * *    rm -f /var/spool/cron/lastrun/cron.hourly

_________________
Vim has excellent syntax highlighting for configuration files: emerge gentoo-syntax
Learn how to use Vim: vimtutor
Back to top
View user's profile Send private message
lordfirebird
n00b
n00b


Joined: 24 May 2004
Posts: 43

PostPosted: Thu May 12, 2005 7:34 am    Post subject: Reply with quote

hehe, well! I had a feeling the answer would make me feel dumb :oops:

Yeah... I bet that's it right there... that crontab was the one that was created with vixiecron so I didn't think to question it... I'll remove "root" from it and if you don't hear back from me, problem solved :D
Back to top
View user's profile Send private message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Thu May 12, 2005 2:38 pm    Post subject: Reply with quote

lordfirebird,

Actually, I am the one who should feel dumb :!: ... It was late last night, and I have no idea what I was thinking ... but the crontab you posted above, which is really /etc/crontab and not that produced by crontab -l is correct. I have the exact same thing in my /etc/crontab. :oops:
_________________
Vim has excellent syntax highlighting for configuration files: emerge gentoo-syntax
Learn how to use Vim: vimtutor
Back to top
View user's profile Send private message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Thu May 12, 2005 2:54 pm    Post subject: Reply with quote

lordfirebird,

After doing some reading of my own and rereading your initial post, I think I might understand what's going on. The key is that you said you have gotten your internal mail working now. My guess is you probably need to change the following line now, but I am unsure what it should be changed to
Code:
MAILTO=root


If there is no "internal mail" setup, I think the above line allows cron to send messages to /root/dead.letter. Otherwise, I understand that you can stop cron from sending messages by setting MAILTO="". If you can avoid that solution, I think it would be best, as that is the only means of getting error messages from cron should something be wrong -- at least that's my understanding.
_________________
Vim has excellent syntax highlighting for configuration files: emerge gentoo-syntax
Learn how to use Vim: vimtutor
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum