Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!seismo!mcvax!ukc!reading!onion!riddle!news From: news@riddle.UUCP Newsgroups: news.admin Subject: Re: rn problem with news 2.11 Message-ID: <369@riddle.UUCP> Date: Fri, 12-Jun-87 16:51:21 EDT Article-I.D.: riddle.369 Posted: Fri Jun 12 16:51:21 1987 Date-Received: Sun, 14-Jun-87 21:58:38 EDT References: <819@mouska.UUCP> <550@acer.stl.stc.co.uk> Organization: Sphinx Ltd., Maidenhead, England Lines: 52 Summary: Shell script parses active, creates directories In article <550@acer.stl.stc.co.uk>, dww@stl.stc.co.uk (David Wright) writes: > In article <819@mouska.UUCP> glee@cognos.uucp (Godfrey Lee) writes: > >In 2.11, the directory was created with the first article. > >It seems that rn (4.1) has trouble with this. > > What I do is to create the directory manually every time I get told that a > new group has been created (our system is set to mail News Admin (me) for > such control messages). When we had a large number of new groups created > recently I edited the mail headers into a script of 'mkdir's. What follows is a shell script I created to do just that. Sorry. It's not bundled up into shar format or anything. Just cut it out... : # chkactdir # Script which creates any directories required by the active file, but # which do not currently exist. Works by generating for each group # in active the names of all directories required for that group # under /usr/spool/news (topmost first) and passing on the names of # those which do not exist. The resulting list is sorted to # eliminate duplicates and make sure parent directories are specified # ahead of their children. Mkdir does the rest. # # Usage: chkactdir # SPOOL and ACTIVE, if set in the environment, override the defaults # of /usr/spool/news and /usr/lib/news/active respectively. # # 870609 DFD Created umask 22 ( OIFS=$IFS while read i junk do IFS=${IFS}. set $i IFS=$OIFS dir=${SPOOL-/usr/spool/news} for j do dir=$dir/$j if [ ! -d $dir ] then echo $dir fi done done ) < ${ACTIVE-/usr/lib/news/active} | sort -u | xargs mkdir 2> /dev/null That's it. Dominic Dunlop UKnet: domo@sphinx.co.uk