ArielGlenn has uploaded a new change for review.
https://gerrit.wikimedia.org/r/233683
Change subject: dumps: job 'createdir' which just creates new dir for dump run
......................................................................
dumps: job 'createdir' which just creates new dir for dump run
this will also create the index.html and status files in the
dump directory; these are used by user scripts or other dump
scripts to check the current status, with no files no information
would be returned
Change-Id: I048b779dda0c5b782e591f1e66f28ad70d32837e
---
M xmldumps-backup/worker.py
1 file changed, 13 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/dumps
refs/changes/83/233683/1
diff --git a/xmldumps-backup/worker.py b/xmldumps-backup/worker.py
index 4392c01..8e692e6 100644
--- a/xmldumps-backup/worker.py
+++ b/xmldumps-backup/worker.py
@@ -578,6 +578,7 @@
if (self._singleJob and self._chunkToDo):
if (self._singleJob[-5:] == 'table' or
self._singleJob[-9:] == 'recombine' or
+ self._singleJob == 'createdirs' or
self._singleJob == 'noop' or
self._singleJob == 'latestlinks' or
self._singleJob == 'xmlpagelogsdump' or
@@ -590,6 +591,7 @@
if (self._singleJob[-5:] == 'table' or
self._singleJob[-9:] == 'recombine' or
self._singleJob == 'noop' or
+ self._singleJob == 'createdirs' or
self._singleJob == 'latestlinks' or
self._singleJob == 'xmlpagelogsdump' or
self._singleJob == 'pagetitlesdump' or
@@ -774,11 +776,12 @@
if not skipgood or item.status() !=
"done":
item.setToBeRun(True)
return True
- if job == "noop" or job == "latestlinks":
+ if job == "noop" or job == "latestlinks" or job == "createdirs":
return True
sys.stderr.write("No job of the name specified exists. Choose
one of the following:\n")
sys.stderr.write("noop (runs no job but rewrites md5sums file
and resets latest links)\n")
sys.stderr.write("latestlinks (runs no job but resets latest
links)\n")
+ sys.stderr.write("createdirs (runs no job but creates dump dirs
for the given date)\n")
sys.stderr.write("tables (includes all items below that end in
'table')\n")
for item in self.dumpItems:
sys.stderr.write("%s\n" % item.name())
@@ -1684,6 +1687,8 @@
if self.jobRequested == "latestlinks":
self._statusEnabled = False
+
+ if self.jobRequested == "latestlinks" or self.jobRequested ==
"createdirs":
self._checksummerEnabled = False
self._runInfoFileEnabled = False
self._noticeFileEnabled = False
@@ -1890,6 +1895,13 @@
# forgets to set the status. This is a failure
as well.
self.runHandleFailure()
+ # special case
+ if self.jobRequested == "createdirs":
+ if not
os.path.exists(os.path.join(self.wiki.publicDir(), self.wiki.date)):
+
os.makedirs(os.path.join(self.wiki.publicDir(), self.wiki.date))
+ if not
os.path.exists(os.path.join(self.wiki.privateDir(), self.wiki.date)):
+
os.makedirs(os.path.join(self.wiki.privateDir(), self.wiki.date))
+
if (self.dumpItemList.allPossibleJobsDone(self.skipJobs)):
# All jobs are either in status "done", "wating",
"failed",."skipped"
self.status.updateStatusFiles("done")
--
To view, visit https://gerrit.wikimedia.org/r/233683
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I048b779dda0c5b782e591f1e66f28ad70d32837e
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