I would like to submit for your consideration a patch to nntpsend. The patch adds a flag, "-w delay", where delay is a number of seconds to wait after flushing the site, but before launching innxmit. The purpose is to avoid competing with another feed that goes over a less expensive link, by giving that feed time to feed all the articles it can before innxmit offers them. If you like the patch, I will work up a corresponding patch to the man page. -- Ben Rosengart (212) 741-4400 x215 EOF -- Attached file included as plaintext by Listar -- --- nntpsend 2001/10/19 20:48:18 1.1 +++ nntpsend 2001/10/19 23:49:00 1.9 @@ -1,12 +1,12 @@ #! /bin/sh . /pkg/inn-2.3.2/lib/innshellvars -## $Revision: 1.1 $ +## $Revision: 1.9 $ ## Send news via NNTP by running several innxmit processes in the background. ## Usage: ## nntpsend [-n][-p][-r][-s size][-S][-t timeout][-T limit][host fqdn]... ## -a Always have innxmit rewrite the batchfile -## -d debug mode, run ixxmmits with debug as well +## -d debug mode, run innxmits with debug as well ## -D same as -d except innxmits are not debugged ## -p Run innxmit with -p to prune batch files ## -r innxmit, don't requeue on unexpected error code @@ -16,6 +16,7 @@ ## -T limit innxmit connection transmit time limit (def: forever) ## -P portnum port number to use ## -n do not lock for nntpsend, do not sleep between sets +## -w delay wait delay seconds just before innxmit ## 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. @@ -38,6 +39,7 @@ TIMELIMIT= PP_FLAG= NOLOCK= +W_SECONDS= ## Parse JCL. MORETODO=true @@ -112,6 +114,14 @@ X-n) NOLOCK=true ;; + X-w) + if [ -z "$2" ] ; then + echo "${PROGNAME}: option requires an argument -- w" 1>&2 + exit 1 + fi + W_SECONDS="$2" + shift + ;; X--) shift MORETODO=false @@ -283,6 +293,15 @@ X-T*) TIMELIMIT_PARAM="$1" ;; + X-w) + if [ -z "$2" ] ; then + echo "${PROGNAME}: option requires an argument -- w" 1>&2 + rm -f "${NNTPLOCK}" "${LOCK}" + exit 1 + fi + W_SECONDS="$2" + shift + ;; *) MORETODO=false ;; @@ -385,7 +404,7 @@ fi ## Start sending this site in the background. - export MAXSIZE SITE HOST PROGNAME PARENTPID SIZE TMPDIR LOCK BATCHFILE + export MAXSIZE SITE HOST PROGNAME PARENTPID SIZE TMPDIR LOCK BATCHFILE W_SECONDS sh -c ' # grab the lock from the parent # @@ -402,6 +421,10 @@ if [ -f "${BATCHFILE}" ]; then test -n "${SIZE}" && shrinkfile -m${MAXSIZE} -s${SIZE} -v ${BATCHFILE} if [ -s ${BATCHFILE} ] ; then + if [ -n "${W_SECONDS}" ] ; then + echo "${PROGNAME}: [${PARENTPID}:$$] sleeping ${W_SECONDS} seconds before ${SITE}" + sleep "${W_SECONDS}" + fi echo "${PROGNAME}: [${PARENTPID}:$$] begin ${SITE} `date`" echo "${PROGNAME}: [${PARENTPID}:$$] innxmit ${INNFLAGS} ${HOST} ..." eval innxmit ${INNFLAGS} ${HOST} ${BATCH}/${BATCHFILE}