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)