Index: branches/ariel/xmldumps-backup/worker.py |
— | — | @@ -505,6 +505,7 @@ |
506 | 506 | if (self._singleJob[-5:] == 'table' or |
507 | 507 | self._singleJob[-9:] == 'recombine' or |
508 | 508 | self._singleJob == 'noop' or |
| 509 | + self._singleJob == 'latestlinks' or |
509 | 510 | self._singleJob == 'xmlpagelogsdump' or |
510 | 511 | self._singleJob == 'pagetitlesdump' or |
511 | 512 | self._singleJob.endswith('recombine')): |
— | — | @@ -514,6 +515,7 @@ |
515 | 516 | if (self._singleJob[-5:] == 'table' or |
516 | 517 | self._singleJob[-9:] == 'recombine' or |
517 | 518 | self._singleJob == 'noop' or |
| 519 | + self._singleJob == 'latestlinks' or |
518 | 520 | self._singleJob == 'xmlpagelogsdump' or |
519 | 521 | self._singleJob == 'pagetitlesdump' or |
520 | 522 | self._singleJob == 'abstractsdump' or |
— | — | @@ -651,11 +653,12 @@ |
652 | 654 | if (item.name() == job): |
653 | 655 | item.setToBeRun(True) |
654 | 656 | return True |
655 | | - if job == "noop": |
| 657 | + if job == "noop" or job == "latestlinks": |
656 | 658 | return True |
657 | 659 | print "No job of the name specified exists. Choose one of the following:" |
658 | | - print "noop (runs no job but rewrites md5sums file and resets latest links" |
659 | | - print "tables (includes all items below that end in 'table'" |
| 660 | + print "noop (runs no job but rewrites md5sums file and resets latest links)" |
| 661 | + print "latestlinks (runs no job but resets latest links)" |
| 662 | + print "tables (includes all items below that end in 'table')" |
660 | 663 | for item in self.dumpItems: |
661 | 664 | print "%s " % item.name() |
662 | 665 | return False |
— | — | @@ -1518,6 +1521,22 @@ |
1519 | 1522 | self._cleanupOldFilesEnabled = False |
1520 | 1523 | |
1521 | 1524 | self.jobRequested = job |
| 1525 | + |
| 1526 | + if self.jobRequested == "latestlinks": |
| 1527 | + self._statusEnabled = False |
| 1528 | + self._checksummerEnabled = False |
| 1529 | + self._runInfoFileEnabled = False |
| 1530 | + self._noticeFileEnabled = False |
| 1531 | + self._makeDirEnabled = False |
| 1532 | + self._cleanOldDumpsEnabled = False |
| 1533 | + self._cleanupOldFilesEnabled = False |
| 1534 | + self._checkForTruncatedFilesEnabled = False |
| 1535 | + |
| 1536 | + if self.jobRequested == "noop": |
| 1537 | + self._cleanOldDumpsEnabled = False |
| 1538 | + self._cleanupOldFilesEnabled = False |
| 1539 | + self._checkForTruncatedFilesEnabled = False |
| 1540 | + |
1522 | 1541 | self.dbServerInfo = DbServerInfo(self.wiki, self.dbName, self.logAndPrint) |
1523 | 1542 | self.dumpDir = DumpDir(self.wiki, self.dbName) |
1524 | 1543 | |
— | — | @@ -1877,7 +1896,7 @@ |
1878 | 1897 | for f in files: |
1879 | 1898 | if f.endswith("-rss.xml"): |
1880 | 1899 | filename = f[:-8]; |
1881 | | - link = os.path.join(latestDir,filename) |
| 1900 | + link = os.path.join(latestDir,f) |
1882 | 1901 | if not exists(link): |
1883 | 1902 | os.remove(os.path.join(latestDir,f)) |
1884 | 1903 | |