Added simple check before compression, seems to work.

git-svn-id: https://wikiteam.googlecode.com/svn/trunk@648 31edc4fc-5e31-b4c4-d58b-c8bc928bcb95
pull/117/head
nemobis 12 years ago
parent a8f2cb283b
commit 4e94d76578

@ -76,9 +76,19 @@ for wiki in wikis:
wikidir = d
break #stop searching, dot not explore subdirectories
#compress
prefix = wikidir.split('-wikidump')[0]
if wikidir and prefix:
if started and wikidir and prefix:
if (subprocess.call (['tail -n 1 %s/%s-history.xml | grep -q "</mediawiki>"' % (wikidir, prefix)], shell=True) ):
finished = False
print "No </mediawiki> tag found: dump failed, needs fixing; resume didn't work. Exiting."
else:
finished = True
# You can also issue this on your working directory to find all incomplete dumps:
# tail -n 1 */*-history.xml | grep -Ev -B 1 "</page>|</mediawiki>|==|^$"
#compress
if finished:
time.sleep(1)
os.chdir(wikidir)
print 'Changed directory to', os.getcwd()
@ -91,4 +101,4 @@ for wiki in wikis:
os.system('7z a -ms=off -mx=1 ../%s-wikidump.7z images/' % prefix)
os.chdir('..')
print 'Changed directory to', os.getcwd()
time.sleep(1)
time.sleep(1)
Loading…
Cancel
Save