Xref: utzoo news.software.b:2585 news.sysadmin:2569 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!netcom!dlb!dave From: dave@dlb.uucp (Dave Buck) Newsgroups: news.software.b,news.sysadmin Subject: Re: How do I issue a "sendme" control message? Summary: Collect ids, give to 'inews -t "cmsg ihave xxx" -n to.yyy.ctl' Keywords: ihave, sendme, control Message-ID: <1989Jul18.154058.2638@dlb.uucp> Date: 18 Jul 89 15:40:58 GMT References: <749@icus.islp.ny.us> Reply-To: dave@dlb.UUCP (Dave Buck) Organization: D.L.Buck & Associates, Inc.; San Jose, Calif. Lines: 87 In article <749@icus.islp.ny.us> lenny@icus.islp.ny.us (Lenny Tropiano) writes: >I had the infamous System V i-node demon attack me today... lost all >my i-nodes, and then did a fsck and they came back. Lost about 40 news >articles, I would like to retrieve them. How would I go about >issuing a "sendme" control message with those message-id's that are >in my errlog ... I often suffer from the same set of problems with inodes here. I got upset over the loss of news articles, as we feed other sites as well. I noticed, as you did, that the error log has the article ids in it, and thought "if I made this into a sendme message, what would happen?" I created the attached perl script to scan the error log, get rid of some of the garbage I don't want to hear about, and looked for the "no space" etc. messages. I obtained the article ids, then invoked "inews" to create an "ihave" message indicating the system having those articles was one that I expected did have all those articles. Inews then discards the article ids that we already have, possibly due to having received the articles in the interim from another site, and turns the message into a "sendme", and we get the articles. Works great for me. You mileage may vary, and I expect to hear lotsa flames from better perlers about what crap this is, and from others who say "but I don't have perl". Sorry. This can all be done by hand ... just make a list of the ids you missed, one per line and with the <>'s, and give them to "inews" with parameters inews -t "cmsg ihave xxx" -n to.yyy.ctl where "xxx" is the site that usually feeds you, and "yyy" is your site name. In the attached script, "dlb" is our site name, and "ames" is our best feed. By the way, we converted to "C News" recently, and the only foul gripe is that this type of scenerio is not possible (well, not as they've implemented rnews). Their rnews will discard an incoming batch if they think it might not fit, and the lost article ids are not saved. I thought about two approaches to change this behavior ... first thought was to scan the incoming batch for article ids and save them for rerequesting (nah, too difficult) ... second thought was to just save the incoming batch in another file system known to have lotsa space, and let us clean up after the following day. ---- Cut somewhere around here ---- #!/usr/bin/perl -P eval "exec /usr/bin/perl -P -S $0 $*" if $running_under_some_shell; $who="ames"; if ( $#ARGV >= 0 ) { $who = $ARGV[0]; } $sendme = 0; $sendcount = 0; open(errlog,"/usr/lib/news/errlog") || die "Can't read errlog"; open(newlog,">/usr/lib/news/newerrlog"); while () { next if /Unparsable/; next if /moved to junk/; if ( /No space/ || /inews: Write failed/ || /inews: Cannot open \/usr\/spool\/news/ || /inews: write failed to temp file/ || /inews: Cannot reread/ ) { if (! $sendme) { open(inews, '|/usr/lib/news/inews -t "cmsg ihave ' . $who . '" -n to.dlb.ctl'); $sendme = 1; } ($date,$id,$complaint) = split(/\t/); print inews $id, "\n"; $sendcount++; } else { print newlog $_; print $_; }; } close errlog; close newlog; unlink "/usr/lib/news/olderrlog"; rename ("/usr/lib/news/errlog","/usr/lib/news/olderrlog"); rename ("/usr/lib/news/newerrlog","/usr/lib/news/errlog"); if ( $sendme ) { close inews; printf "\n%d articles re-requested via sendme to %s\n", $sendcount,$who; } -- Dave Buck {amdahl,sun,megatest,plx,ardent,ubvax}!dlb!dave D. L. Buck and Associates, Inc.; San Jose, California 95119; (408)972-2825