Don't encrypt COMPLETE files nor choke if they are

May fix:
https://github.com/rtucker/backuppc-archive-s3/issues/2
This commit is contained in:
Ryan Tucker 2012-11-12 16:52:02 -05:00
parent c2ddefb316
commit 5b4d78fea3
2 changed files with 8 additions and 2 deletions

View file

@ -326,7 +326,9 @@ if __name__ == '__main__':
# Run again to send files to the relevant queue # Run again to send files to the relevant queue
for i in sorted(glob.glob(fileglob)): for i in sorted(glob.glob(fileglob)):
if secrets.gpgsymmetrickey and not i.endswith('.gpg'): if (secrets.gpgsymmetrickey
and not i.endswith('.gpg')
and not i.endswith('.COMPLETE')):
# A tar file, unencrypted, needs encrypted. # A tar file, unencrypted, needs encrypted.
logger.debug("main: adding %s to gpg_queue", i) logger.debug("main: adding %s to gpg_queue", i)
gpg_queue.put([i, secrets.gpgsymmetrickey, compPath]) gpg_queue.put([i, secrets.gpgsymmetrickey, compPath])

View file

@ -88,7 +88,11 @@ def list_backups(bucket):
tarred = True tarred = True
keyparts.pop() keyparts.pop()
backupnum = int(keyparts.pop()) nextpart = keyparts.pop()
if nextpart == 'COMPLETE':
print("Stray file: %s" % key.key)
continue
backupnum = int(nextpart)
hostname = '.'.join(keyparts) hostname = '.'.join(keyparts)
lastmod = time.strptime(key.last_modified, '%Y-%m-%dT%H:%M:%S.000Z') lastmod = time.strptime(key.last_modified, '%Y-%m-%dT%H:%M:%S.000Z')