ArielGlenn has submitted this change and it was merged.
Change subject: dumps: allow user to specify how long dumper sleeps between
wikis
......................................................................
dumps: allow user to specify how long dumper sleeps between wikis
there is now the 'createdirs' job which takes virtually no time
per wiki, running this across all wikis should not take 950/2 minutes
i.e. 7 hours. for some jobs the default sleep time is a negligible
portion of the time to run so it's fine.
Change-Id: Ibdb0be5be062e1358f5016618bacfda0c60c5f87
---
M xmldumps-backup/worker
1 file changed, 9 insertions(+), 2 deletions(-)
Approvals:
ArielGlenn: Verified; Looks good to me, approved
jenkins-bot: Verified
diff --git a/xmldumps-backup/worker b/xmldumps-backup/worker
index b00a8e0..e16f39d 100755
--- a/xmldumps-backup/worker
+++ b/xmldumps-backup/worker
@@ -3,7 +3,8 @@
usage() {
echo "$0: Unknown option $1"
echo "Usage: $0 [--configfile filename] [--log] [--maxfails num]
[--basedir dir] [--wiki wikiname]"
- echo " [--cutoff date] [--date date] [--job job] [--skipjobs
joblist] [--skipdone] [--exclusive]"
+ echo " [--cutoff date] [--date date] [--job job] [--skipjobs
joblist] [--skipdone]"
+ echo " [--exclusive] [--onepass] [--sleep]"
echo "--configfile use specified file for config file (default:
wikidump.conf)"
echo "--log write log of (almost) everything written to stderr
(default: no logging)"
echo "--maxfails if more than this many dumps fail in a row, exit
(default: 3)"
@@ -19,6 +20,7 @@
echo "--wiki name of specific wiki db to dump; otherwise all wikis
in list referenced by"
echo " config file will be dumped"
echo "--onepass if there are no wikis to dump (--skipdone option)
then exit"
+ echo "--sleep time to sleep between jobs, default 30 seconds"
echo
echo "If the file maintenance.txt is present, no more jobs will be run,
and"
echo "this script will check the status again in 5 minutes."
@@ -49,6 +51,8 @@
EXCLUSIVE=""
# if no wikis are left to run, exit
ONEPASS=""
+ # time to sleep between wikis, in seconds
+ SLEEP=30
}
process_opts() {
@@ -79,6 +83,9 @@
shift; shift
elif [ $1 == "--skipjobs" ]; then
SKIPJOBS="$2"
+ shift; shift
+ elif [ $1 == "--sleep" ]; then
+ SLEEP="$2"
shift; shift
elif [ $1 == "--onepass" ]; then
ONEPASS=true
@@ -181,7 +188,7 @@
fi
fi
echo "sleeping"
- sleep 30
+ sleep "$SLEEP"
}
main_loop() {
--
To view, visit https://gerrit.wikimedia.org/r/233953
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibdb0be5be062e1358f5016618bacfda0c60c5f87
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: ariel
Gerrit-Owner: ArielGlenn <[email protected]>
Gerrit-Reviewer: ArielGlenn <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits