doug@cogent.UUCP (Doug Perlich) (11/18/89)
I have an odd problem maybe someone out there can help me with. I believe this is the correct newsgroup. I inherited the job of taking care of the news here and I'm having problems with the expire program or cron, I'm not sure which. The previous news administrator left a cronfile for news as follows: 0 1 * * * /usr/lib/news/expire -r -I -e 999999 | cat -v | mail news 0 3 * * * /usr/lib/news/expire -e 4 -E 21 | cat -v | mail news We are fairly short on disk space so we can really only keep 4 days worth of news (the second line). I don't really understand the first line, it's supposed to rebuild the history file, right? Does that really need to be done every night. If I take the first line out the second line will do NOTHING!, at least our news articles don't expire without the first line. That's my first question, why is the first line needed at all. My second problem. I must be dreaming or something but it appears that cron will execute these commands fine for a few days, then it seems to just quit doing the first line. The cron log quits showing two expires and only shows one and our news starts to fill up again. AAAAaaaaarrgh! I've looked at the doc's for expire and cron and can't figure this out! HELP! -Doug g g
scott@nastar.UUCP (Scott Barman) (11/21/89)
In article <620@cogent.UUCP> doug@cogent.UUCP (Doug Perlich) writes: >I have an odd problem maybe someone out there can help me with. >I believe this is the correct newsgroup. > >I inherited the job of taking care of the news here and I'm having >problems with the expire program or cron, I'm not sure which. >The previous news administrator left a cronfile for news as follows: > 0 1 * * * /usr/lib/news/expire -r -I -e 999999 | cat -v | mail news > 0 3 * * * /usr/lib/news/expire -e 4 -E 21 | cat -v | mail news > >We are fairly short on disk space so we can really only keep 4 days worth >of news (the second line). I don't really understand the first line, >it's supposed to rebuild the history file, right? Does that really >need to be done every night. If I take the first line out the second >line will do NOTHING!, at least our news articles don't expire without >the first line. That's my first question, why is the first line >needed at all. The first line should be done periodically. Twice a month (the first and fifteenth) we execute the following shell script (on a Sun3 running 3.5): #!/bin/sh find /usr/spool/news -type f \( -size 0 -o -mtime +10 \) -exec /bin/rm -f {} \; /usr/lib/news/expire -r -I -e999999 -E999999 It gets executed with the line in the crontab line: 0 3 1,15 * * /bin/su uucp -c /usr/lib/news/news_cleanup The bad thing about this is that articles that have set expiration dates tend to vanish. We do not worry about them because we make other arrangements for them (e.g. comp.mail.maps and news.announce.newusers). Anything else it just about out of luck unless the users save it! As far as the nightly expire, we stagger what we expire and when (i.e. rec.* and soc.* expires after 2 days, talk.*, *.test, junk 1 day, sources in 7, etc.). I just put it in a shell script and execute the shell script from cron. Because of your second problem: >My second problem. I must be dreaming or something but it appears that cron >will execute these commands fine for a few days, then it seems to just quit >doing the first line. The cron log quits showing two expires and only shows >one and our news starts to fill up again. AAAAaaaaarrgh! We got hit by this. After I put it into a shell script, it has worked with no problems since. I have found many strange things with the SunOS cron (i.e. why does is barf on ranges?) so I just drop what I need in a shell script and let it do the work and to hell with Sun's brain damage! -- scott barman {gatech, emory}!nastar!scott