news.daily and dropped innfeed files
Russ Allbery
rra at stanford.edu
Wed Apr 29 20:46:33 UTC 2009
Julien ÉLIE <julien at trigofacile.com> writes:
> I think something like that should work in news.daily:
>
> # Try to find the path to innfeed's spool. The default is
> # ${PATHSPOOL}/innfeed if not found.
> INNFEEDSPOOL=`${AWK} '{gsub(/:|#/, " & ")} {if ($1 == "backlog-directory" && $2 == ":") print $3}' ${PATHETC}/innfeed.conf`
> test -z "${INNFEEDSPOOL}" && test -f "${PATHSPOOL}/innfeed" && INNFEEDSPOOL="innfeed"
>
> if [ -d "${PATHSPOOL}/${INNFEEDSPOOL}" ]
> then
> cd "${PATHSPOOL}/${INNFEEDSPOOL}"
>
> # Find the PIDs of innfeed.
> LOCKS=`cat *.lock | ${SORT} -u`
Portability paranoia says that you should use '| sort | uniq' here,
since sort -u is a GNUism.
> # Process files like "innfeed-dropped.A001703" where
> # 1703 is not in $LOCKS.
> for file in $(find -name "innfeed-dropped*")
I've tended to use backticks instead of $(), but I don't know if there's
really any problem with $() on any shell that we care about. Usually
Solaris /bin/sh is the worst.
Otherwise, this looks great to me.
--
Russ Allbery (rra at stanford.edu) <http://www.eyrie.org/~eagle/>
Please send questions to the list rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
More information about the inn-workers
mailing list