Article View: news.software.nntp
Article #5665NNTPSEND pre-sort patch (UNOFF4)
From: Mike Bird
Date: Fri, 15 Mar 1996 00:00
Date: Fri, 15 Mar 1996 00:00
106 lines
3820 bytes
3820 bytes
Here is the inn1.4unoff4 version of the nntpsend pre-sort patch.
This patch enables '-b' to pre-sort the outgoing batch.
A pre-sorted batch is much more efficient if the destination
host has a single spool spindle (and may be faster for small
numbers of spindles) because it reduces directory thrashing.
--Mike
-------------------------------------
--- nntpsend.unoff4 Wed Mar 13 16:14:13 1996
+++ nntpsend Thu Mar 14 23:18:54 1996
@@ -2,7 +2,7 @@
## $Revision: 1.8 $
## Send news via NNTP by running several innxmit processes in the background.
## Usage:
-## nntpsend [-p][-r][-s size][-S][-t timeout][-T limit][host fqdn]...
+## nntpsend [-p][-r][-s size][-S][-t timeout][-T limit][-b][host fqdn]...
## -p Run innxmit with -p to prune batch files
## -r innxmit, don't requeue on unexpected error code
## -s size limit the .nntp file to size bytes
@@ -11,6 +11,7 @@
## -t timeout innxmit timeout to make connection (def: 180)
## -T limit innxmit connection transmit time limit (def: forever)
## -P portnum port number to use
+## -b sort batch (for single spindle destinations)
## host fqdn send to host and qualified domain (def: nntpsend.ctl)
## If no "host fqdn" pairs appear on the command line, then ${CTLFILE}
## file is read.
@@ -28,6 +29,7 @@
R_FLAG=
S_FLAG=
C_FLAG=
+B_FLAG=
TRUNC_SIZE=
T_FLAG=
TIMELIMIT=
@@ -52,6 +54,9 @@
X-c)
C_FLAG="-c"
;;
+ X-b)
+ B_FLAG="-b"
+ ;;
X-s)
if [ -z "$2" ] ; then
echo "${PROGNAME}: option requires an argument -- s" 1>&2
@@ -152,7 +157,7 @@
echo "${PROGNAME}: [${PARENTPID}] start"
## Set up environment.
-export BATCH PROGNAME PARENTPID INNFLAGS
+export BATCH PROGNAME PARENTPID INNFLAGS B_FLAG
## Loop over all sites.
cat ${INPUT} | while read SITE HOST MAXSIZE FLAGS; do
@@ -173,6 +178,7 @@
R_PARAM=
S_PARAM=
C_PARAM=
+ B_PARAM=
PP_PARAM=
TIMEOUT_PARAM=
TIMELIMIT_PARAM=
@@ -192,6 +198,9 @@
X-c)
C_PARAM="-c"
;;
+ X-b)
+ B_PARAM="-b"
+ ;;
X-p)
P_PARAM="-p"
;;
@@ -284,7 +293,7 @@
fi
## Start sending this site in the background.
- export SITE HOST LOCKS BATCHFILE PROGNAME PARENTPID SIZE TMPDIR
+ export SITE HOST LOCKS BATCHFILE PROGNAME PARENTPID SIZE TMPDIR B_PARAM
sh -c '
BATCHFILE=${SITE}.nntp
LOCK=${LOCKS}/LOCK.${SITE}
@@ -305,8 +314,12 @@
test -n "${SIZE}" && shrinkfile -s${SIZE} -v ${BATCHFILE}
if [ -s ${BATCHFILE} ] ; then
echo "${PROGNAME}: [${PARENTPID}:$$] begin ${SITE} `date`"
+ if [ -n "${B_FLAG}${B_PARAM}" ] ; then
+ echo "${PROGNAME}: [${PARENTPID}:$$] sort -r ${BATCHFILE} -o ${BATCHFILE}"
+ sort -r ${BATCHFILE} -o ${BATCHFILE}
+ fi
echo "${PROGNAME}: [${PARENTPID}:$$] innxmit ${INNFLAGS} ${HOST} ${BATCH}/${BATCHFILE}"
- eval innxmit ${INNFLAGS} ${HOST} ${BATCH}/${BATCHFILE}
+ innxmit ${INNFLAGS} ${HOST} ${BATCH}/${BATCHFILE}
echo "${PROGNAME}: [${PARENTPID}:$$] end ${SITE} `date`"
else
rm -f ${BATCHFILE}
----------------------------------------------------------
Mike Bird Tel: 209-742-5000 FAX: 209-966-3177
President POP: 209-742-5333 NOC: 209-742-9979
Iron Mtn Systems http://www.ims.mariposa.ca.us/
Technical Details
Message-ID:
<4ib76t$gqb@news.ims.mariposa.ca.us>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <4ib76t$gqb@news.ims.mariposa.ca.us> Subject: NNTPSEND pre-sort patch (UNOFF4) Date: Fri, 15 Mar 1996 00:00:00 +0000 From: mgb@ims.mariposa.ca.us (Mike Bird) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 142724151 Organization: Iron Mtn Systems Newsgroups: news.software.nntp