From 07777a86286153ff4aa284518d2af72d78f73c09 Mon Sep 17 00:00:00 2001 From: Ryan Tucker Date: Tue, 29 Dec 2009 08:48:39 -0500 Subject: [PATCH] moving bucket opening towards beginning --- BackupPC_archiveHost_s3 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BackupPC_archiveHost_s3 b/BackupPC_archiveHost_s3 index 19d3058..edb59a1 100755 --- a/BackupPC_archiveHost_s3 +++ b/BackupPC_archiveHost_s3 @@ -120,6 +120,9 @@ for i in [tarCreate, compPath, splitPath, parPath]: sys.stderr.write('Error: %s is not an executable program\n' % i) sys.exit(1) +# open s3 connection +bucket = open_s3(secrets.accesskey, secrets.sharedkey, host) + mesg = "Writing archive for host %s, backup #%i" % (host, bkupNum) if splitSize > 0 and is_exe(splitPath): mesg += ', split into %i byte chunks' % splitSize @@ -153,8 +156,6 @@ if returncode != 0: logging.info('Beginning post-processing of %s #%i' % (host, bkupNum)) -bucket = open_s3(secrets.accesskey, secrets.sharedkey, host) - for i in sorted(glob.glob(fileglob)): if secrets.gpgsymmetrickey: sendfile = encrypt_file(i, secrets.gpgsymmetrickey, compPath)