Path: utzoo!utgpu!watmath!clyde!ima!cfisun!lakart!dg From: dg@lakart.UUCP (David Goodenough) Newsgroups: news.admin Subject: Re: Auto-expiration of news Message-ID: <341@lakart.UUCP> Date: 25 Nov 88 03:49:05 GMT References: <1066@psuhcx.psu.edu> Organization: Lakart Corporation, Newton, MA Lines: 34 From article <1066@psuhcx.psu.edu>, by wcf@psuhcx (Bill Fenner): > Does anyone have a good way to expire news automatically when the news > partition gets full? We only have a 25 meg partition for news, and it > often manages to fill up on weekends, and it's a big pain to come in > to find a console log 5 inches thick with logs of /usr/spool/news: write > failed, filesystem full. Lets see. I use the following shell script line to expire news on a daily basis: find /usr/spool/news -mtime +7 -type f -exec rm \{\} \; 2>&1 >/dev/null and the following on a weekly basis to prevent the history file from oozing all over /usr: expire -e 7 -i -r Now write an awk script (or a C program) that takes a look at the output from df, to see how crammed your news partition is, and adjust the '-mtime +7' bitty in the find command as appropriate (i.e. +5 if the partition is getting full, and +7 or more if it's empty) The find / expire combination is recommended to any sysadmins who are really getting fed up of running an hour long expire a night. If you set the expire to happen on Sunday morning (say at 9:00), you can let it take forever, and it won't dent the system quite as bad. Of course you may need to pick your time carefully if you're something like ncoast / killer / portal, cause those folks may be on line and active all the time. Still it's a suggestion ..... -- dg@lakart.UUCP - David Goodenough +---+ | +-+-+ ....... !harvard!xait!lakart!dg +-+-+ | AKA: dg%lakart.uucp@harvard.harvard.edu +---+