Make backfill script safer for automated use

* Write output files to a temp dir out of the way, just in case a
  regular dumps worker is working on the same output jobs
* Check that there is no existing partial or full output file in place
  just before starting the maintenance script that would produce it
* Check that there is no existing file in the final location, before
  moving the finished temp file into that location (perhaps a regular
  worker produced it in the meantime)

With bad scheduling it is still possible for this script to work on the
same job as a regular dump worker, and for the regular worker to
generate checksums of its output file which is then overwritten by this
script's output.  But these changes should minimize the possibility.

Bug: T252396
Change-Id: Ib966731c949f0d93bcea36a3e66dffd978a60ce5
1 file changed
tree: 685f5a137f0893aefe218f5ee9679bd064471a9f
  1. xmldumps-backup/
  2. .gitignore
  3. .gitreview
  4. .pep8
  5. tox.ini