Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!rutgers!clyde!mcdchg!falkor!heiby From: heiby@falkor.UUCP (Ron Heiby) Newsgroups: news.sysadmin Subject: Re: Supersedes: filling my disk (not running news 2.11) Message-ID: <107@falkor.UUCP> Date: 30 Dec 87 17:12:54 GMT References: <3727@hoptoad.uucp> <1822@decuac.DEC.COM> Reply-To: heiby@mcdchg.UUCP (Ron Heiby) Organization: Luck Dragons, Etc., Riverwoods, IL Lines: 54 Frederick M. Avolio (avolio@decuac.dec.com) writes: > I am not sure what the problem is. You needn't trash the maps. Just > expire them early... > expire -i -e2 -n comp.mail.maps Perhaps an even simpler method would be something along the lines of: find /usr/spool/news/comp/mail/maps -mtime +2 -type f -print | xargs rm -f Yes, I know that "xargs" is not available on every system. There are similar things that can be done without it, though. (It's really just an efficiency hack.) Anyone who is not a leaf node should make sure that the map articles don't get removed until the sites they feed have had a reasonable chance to get them. Maybe something like the following script would work. I haven't tested it, as I don't currently have a problem with keeping the map articles around. You should test it completely before enabling the "rm" command. Note: If you are running ihave/sendme with another site, then this will almost certainly not work. You'll have to do something much more clever, like grepping out Message-Ids and comparing them with the contents of the .ihave files. Even that won't do it, though, as the "ihave" message may have been sent and the "sendme" not yet received. ----- SPOOLDIR=/usr/spool/news BATCHDIR=/usr/spool/batch # Get pathnames of the map articles. find $SPOOLDIR/comp/mail/maps -type f -print | sort > /tmp/arts.$$ # cat all the outgoing batch files together sort out the map articles cat $BATCHDIR/* 2>/dev/null | grep 'comp/mail/maps' | sort >/tmp/outg.$$ # See if any articles have already been batched and queued. uniq -d /tmp/arts.$$ /tmp/outg.$$ >/tmp/del.$$ # If there are any, then delete them if test -s /tmp/del.$$ then # rm -f `cat /tmp/del.$$` # un-comment when testing done cat /tmp/del.$$ # this line for testing or logging else # else clause for testing or logging echo "No map articles to be deleted." fi # clean up # un-comment rm line when testing done #rm -f /tmp/arts.$$ /tmp/outg.$$ /tmp/del.$$ exit 0 ----- -- Ron Heiby, heiby@mcdchg.UUCP Moderator: comp.newprod & comp.unix "Intel architectures build character."