From 5b4d78fea336bdac8b4c226d7f161cd40a4d2e83 Mon Sep 17 00:00:00 2001 From: Ryan Tucker Date: Mon, 12 Nov 2012 16:52:02 -0500 Subject: [PATCH] Don't encrypt COMPLETE files nor choke if they are May fix: https://github.com/rtucker/backuppc-archive-s3/issues/2 --- BackupPC_archiveHost_s3 | 4 +++- backup-manager.py | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/BackupPC_archiveHost_s3 b/BackupPC_archiveHost_s3 index 3c65e02..ce91aeb 100755 --- a/BackupPC_archiveHost_s3 +++ b/BackupPC_archiveHost_s3 @@ -326,7 +326,9 @@ if __name__ == '__main__': # Run again to send files to the relevant queue 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. logger.debug("main: adding %s to gpg_queue", i) gpg_queue.put([i, secrets.gpgsymmetrickey, compPath]) diff --git a/backup-manager.py b/backup-manager.py index ab73de6..2d84813 100755 --- a/backup-manager.py +++ b/backup-manager.py @@ -88,7 +88,11 @@ def list_backups(bucket): tarred = True 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) lastmod = time.strptime(key.last_modified, '%Y-%m-%dT%H:%M:%S.000Z')