~mdw
/
mirror-admin
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bin/run-mirrors: Command line lists patterns limiting mirrors to run.
[mirror-admin]
/
bin
/
run-mirrors
diff --git
a/bin/run-mirrors
b/bin/run-mirrors
index
c69b903
..
34a3733
100755
(executable)
--- a/
bin/run-mirrors
+++ b/
bin/run-mirrors
@@
-5,11
+5,12
@@
set -e
## Make sure we're running as the right user.
case $(id -un) in
mirror) ;;
## Make sure we're running as the right user.
case $(id -un) in
mirror) ;;
- *) exec userv -fstdin=/dev/null mirror run ;;
+ *) exec userv -fstdin=/dev/null mirror run
"$@"
;;
esac
## Set up a plausible environment.
esac
## Set up a plausible environment.
-HOME=/mnt/ftp/mirror-admin; export HOME; cd
+HOME=/var/lib/mirror-admin; export HOME; cd
+MIRRORS=/mnt/mirrors; export MIRRORS
PATH=$HOME/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin
export PATH
umask 002
PATH=$HOME/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin
export PATH
umask 002
@@
-19,6
+20,11
@@
case "${MIRROR_LOCKED-nil}" in
nil) exec env MIRROR_LOCKED=t locking -f var/mirror.lock "$0" "$@" ;;
esac
nil) exec env MIRROR_LOCKED=t locking -f var/mirror.lock "$0" "$@" ;;
esac
+## Hack for mad Kerberized NFS.
+if [ -r etc/krb5.keytab ]; then
+ kinit -k -t etc/krb5.keytab mirror
+fi
+
## Before we start, rotate the logs. (Doing things this way means that we
## can be sure we don't lose new logs, even if the log rotation goes
## completely mental.
## Before we start, rotate the logs. (Doing things this way means that we
## can be sure we don't lose new logs, even if the log rotation goes
## completely mental.
@@
-27,9
+33,20
@@
logrotate -s var/logrotate.state etc/logrotate.conf
## Let SIGINT take out the children only.
trap "" INT
## Let SIGINT take out the children only.
trap "" INT
+## By default run all of the scripts.
+case $# in 0) set "*" ;; esac
+
## Now do the various mirroring things.
for file in $(run-parts --list etc/mirrors.d); do
[ -x "$file" ] || continue
## Now do the various mirroring things.
for file in $(run-parts --list etc/mirrors.d); do
[ -x "$file" ] || continue
+
+ matchp=nil
+ leaf=$(echo "$file" | sed 's:^.*/::; s/^[0-9]\+[-_.]//')
+ for pat in "$@"; do
+ case "$leaf" in $pat) matchp=t; break ;; esac
+ done
+ case $matchp in nil) continue ;; esac
+
base=${file##*/}; base=${base#[0-9]*-}
(
echo
base=${file##*/}; base=${base#[0-9]*-}
(
echo