news@t4test.UUCP (Chip Rosenthal) (09/07/84)
This isn't the first time I've lost it. The other times I've gone through and rebuilt it manually. I'm getting tired of doing that. Does anybody have a program which will automatically rebuild 'active' for me? I need either something which will either go through 'history' or '/usr/spool/news/...' and rebuild 'active' from scratch, or go through 'history' or 'log' and bring an outdated backup copy of 'active' up to date. While we are talking about maintaining files, I wrote a program which goes through 'history' and cleans it up. For example, if an article gets deleted from the news spool directory and the line isn't removed from 'history', our 'expire' won't do it either. That's one of the things 'cleanhist' does. If anybody wants a copy, drop me a line. (I'd be happy to trade it for an 'active' file restorer!!!) -- Chip Rosenthal, Intel/Santa Clara { idi|intelca|icalqa|kremvax|qubix|ucscc } ! t4test ! { chip|news }
rick@seismo.UUCP (Rick Adams) (09/20/84)
The following "simple" shell file will restore the active file for any 2.10.2 system. It requires the 2.10.2 expire. Howver, if you are still running 2.10 or 2.10.1, you can convert the active file back to 2.10 format by removing the last 7 characters from each line in the active file (i.e. sed 's/.......$//') ---rick echo x - restore.active sed 's/^X//' >restore.active <<'*-*-END-of-restore.active-*-*' X: recreate the active file from readers .newsrc files X: and from the existing articles X: syntax is restire.active LIBDIR X Xlib=${1-/usr/lib/news} Xtmp=/tmp/$$ X: Find the highest numbered articles from the .newsrcs Xcat `sed 's/[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:// Xs/:.*//' /etc/passwd | sort -u | sed 's;$;/.newsrc;' ` 2>/dev/null | Xsed '/:/!d Xs/:.*[,-]/ / Xs/: */ /' >$tmp X: in case there are groups no-one reads, look in the list of newsgroups Xsed 's/[ ].*/ 1/' $lib/newsgroups >>$tmp Xsort +0 -1 +1nr $tmp | sort -m +0u -1 | sed 's/$/ 00001 y/' >$lib/active X: finally, scanf the spool directory and fix up the active file. X$lib/expire -u Xrm -f $tmp *-*-END-of-restore.active-*-* exit