ArielGlenn has uploaded a new change for review.
https://gerrit.wikimedia.org/r/215661
Change subject: dumps: allow 'last' to be specified as date of run
......................................................................
dumps: allow 'last' to be specified as date of run
this will let us (re)run jobs for one or all wikis for the
last date a dump run, partial or complete, was done
Change-Id: I764e0f4b2dd055a749c5fbc0bde695de6ad85173
---
M xmldumps-backup/worker.py
1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/dumps
refs/changes/61/215661/1
diff --git a/xmldumps-backup/worker.py b/xmldumps-backup/worker.py
index c1edc59..7c9b3a3 100644
--- a/xmldumps-backup/worker.py
+++ b/xmldumps-backup/worker.py
@@ -4162,6 +4162,8 @@
sys.stderr.write( "--configfile: Specify an alternative configuration
file to read.\n" )
sys.stderr.write( " Default config file name:
wikidump.conf\n" )
sys.stderr.write( "--date: Rerun dump of a given date (probably
unwise)\n" )
+ sys.stderr.write( " If 'last' is given as the value,
will rerun dump from last run date if any,\n")
+ sys.stderr.write( " or today if there has never been a
previous run\n")
sys.stderr.write( "--addnotice: Text message that will be inserted in
the per-dump-run index.html\n" )
sys.stderr.write( " file; use this when rerunning some
job and you want to notify the\n" )
sys.stderr.write( " potential downloaders of problems,
for example. This option\n" )
@@ -4338,7 +4340,14 @@
# process any per-project configuration options
config.parseConfFilePerProject(wiki.dbName)
- if not date:
+ if date == 'last':
+ dumps = sorted(wiki.dumpDirs())
+ if dumps:
+ date = dumps[-1]
+ else:
+ date = None
+
+ if date is None or not date:
date = TimeUtils.today()
wiki.setDate(date)
--
To view, visit https://gerrit.wikimedia.org/r/215661
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I764e0f4b2dd055a749c5fbc0bde695de6ad85173
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: ariel
Gerrit-Owner: ArielGlenn <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits