Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cron generating (and emailing) many errors
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
kyptin
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jun 2002
Posts: 95
Location: UNC (Chapel Hill, NC, USA)

PostPosted: Sat Feb 01, 2003 6:38 am    Post subject: Cron generating (and emailing) many errors Reply with quote

So, I have this cronjob in my crontab that I have set up to run every minute. It's there to basically keep me connected to the internet. (Long story; suffice it to say that the University's new in-dorm internet connection policy sucks.)

I have vcron installed, and it performs the job just fine. However, after installing mutt and finally getting postfix configured properly (I hope), I realized I had over 83,000 (yes, you read that right) messages stored up in my /root/.maildir/new/ directory. (--After clearing 13,000 from my mail queue!) One for every single cronjob that had ever ran. They all say something along the lines of: "/bin/sh: root: command not found". After removing the "root" on each line of my /etc/crontab file, these messages disappear. So, is that a bad example for an /etc/crontab file? Is that "root" not supposed to be there for vcron?

On a side note, has anybody ever tried to read or delete 83,000 files in a single directory before? It's insane. After waiting for a minute for ls to display any output, I killed it. Mutt took seemingly hours to start up (which is how I found out I had 83,000 messages). After that, I tried to 'rm -rf *', but bash said something about too many arguments. I eventually had to 'rmdir -rf new', which took many minutes...crazy stuff, let me tell you. By the time it had finished, there were already 8 more messages waiting for me!
Back to top
View user's profile Send private message
Carlos
Guru
Guru


Joined: 07 Aug 2002
Posts: 458
Location: Providence, RI

PostPosted: Thu Feb 06, 2003 4:16 am    Post subject: Re: Cron generating (and emailing) many errors Reply with quote

kyptin wrote:
After removing the "root" on each line of my /etc/crontab file, these messages disappear. So, is that a bad example for an /etc/crontab file? Is that "root" not supposed to be there for vcron?
It probably shouldn't have been there, but it's hard to say unless I know what the relevant line looked like. The general format for a cron job is
[code]minute hour day month year command[code]so for example [code]30 8 * * * xmms -p[/code] will toggle xmms's playing/paused state (starting xmms if it's not running) at 8:30 every day of every month of every ear (great way to wake myself up).

As for dealing with many files, I know what you mean. Sort of. I have to wait long enough opening a mailbox with about 1200 messages in mutt - although I guess it would be faster if I used ReiserFS instead of ext3). I'd hate to have 83,000.
_________________
Man must shape his tools lest they shape him.


Last edited by Carlos on Thu Feb 06, 2003 10:56 am; edited 1 time in total
Back to top
View user's profile Send private message
kyptin
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jun 2002
Posts: 95
Location: UNC (Chapel Hill, NC, USA)

PostPosted: Thu Feb 06, 2003 10:04 am    Post subject: Reply with quote

Yeah, my crontab now looks like you said it should, with 5 time fields, then the command to execute. Before, it was 5 time fields, the 'root', then the command, which threw all those errors. I'd post an example, but I haven't figured out the inane way X-windows likes to copy n' paste things.

Actually, after reading our very own Daniel Robbin's advanced filesystem implementor's guide (check www.ibm.com), he says that that's one of the few areas where reiserfs doesn't outperform ext3 and other FS's: mail directories, and directories where there's a bunch of little files.
Back to top
View user's profile Send private message
Carlos
Guru
Guru


Joined: 07 Aug 2002
Posts: 458
Location: Providence, RI

PostPosted: Thu Feb 06, 2003 11:08 am    Post subject: Reply with quote

kyptin wrote:
Actually, after reading our very own Daniel Robbin's advanced filesystem implementor's guide (check www.ibm.com), he says that that's one of the few areas where reiserfs doesn't outperform ext3 and other FS's: mail directories, and directories where there's a bunch of little files.
Nice, thanks for pointing me to the guide. I had heard about it before, but had somehow assumed that it was a guide for people who aimed to write filesystems.

I did read large parts of a book on filesystems in Linux when I was at a bookstore, and also looked at some stuff online, but I could have sworn that Reiser was supposed to be relatively good with small files, whereas, say, XFS was good with large ones. Time to peruse the guide...
_________________
Man must shape his tools lest they shape him.
Back to top
View user's profile Send private message
kyptin
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jun 2002
Posts: 95
Location: UNC (Chapel Hill, NC, USA)

PostPosted: Thu Feb 06, 2003 8:29 pm    Post subject: ibm's dW Reply with quote

Dude, that guide owns. In fact, pretty much everything Daniel Robbins writes is gold, in my opinion. I'm starting to go through his LPI certification tutorial (also on ibm.com's developerWorks site), and it's really cool. Heck, he started Gentoo--the man can do no wrong! :D

Yeah, it's sorta off topic, but it's good to stop and praise the Gentoo every once in a while. :wink:
Back to top
View user's profile Send private message
Carlos
Guru
Guru


Joined: 07 Aug 2002
Posts: 458
Location: Providence, RI

PostPosted: Fri Feb 07, 2003 3:00 am    Post subject: Reply with quote

Quote:
Dude, that guide owns. In fact, pretty much everything Daniel Robbins writes is gold, in my opinion. I'm starting to go through his LPI certification tutorial (also on ibm.com's developerWorks site), and it's really cool. Heck, he started Gentoo--the man can do no wrong!
Amen. ;)

Anyway, I just started reading part one of the series, and found this:
Advanced filesystem implementor's guide wrote:
But how good is ReiserFS' small file performance in practice? Amazingly good. In fact, ReiserFS is around eight to fifteen times faster than ext2 when handling files smaller than one k in size!
So ReiserFS should give a significant improvement to mail directories.

EDIT: I'm reading part 2 now, and apparently Reiser was bad with repeated stat() calls on many files, which made it slow with large maildir mailboxes with mutt, for example. But then again, this was apparently a problem with the 2.4 series kernels (apparently it didn't happen in 2.2 kernels), and I bet that's fixed by now.
_________________
Man must shape his tools lest they shape him.
Back to top
View user's profile Send private message
Curious
Bodhisattva
Bodhisattva


Joined: 13 May 2002
Posts: 395
Location: Sydney, Australia

PostPosted: Fri Feb 07, 2003 3:34 am    Post subject: Re: Cron generating (and emailing) many errors Reply with quote

kyptin wrote:
Too much mail


Just a tip, if you are running frequent cron commands that will produce stdout input and flood your mailbox, you can set the MAILTO variable in your crontab file - setting it to "" will stop Cron from sending program output around. See 'crontab(5)' for more information.

In your case, better to fix the problem though. :-)

I have had similar problems with a runaway script once - hundreds of mails got sent to my office address, got lost in an MX in Tokyo for two weeks, and then all arrived on my desktop at once.

-- Curious
_________________
Are you down with the Hawk?
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