From d1256d08cc4139c01ab7c23687956a2b0075ff35 Mon Sep 17 00:00:00 2001 From: Ryan Tucker Date: Mon, 4 Jan 2010 21:04:18 -0500 Subject: [PATCH] dupe file checking was not; adding more basename action to send_file --- BackupPC_archiveHost_s3 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/BackupPC_archiveHost_s3 b/BackupPC_archiveHost_s3 index efb784d..c1924a3 100755 --- a/BackupPC_archiveHost_s3 +++ b/BackupPC_archiveHost_s3 @@ -205,11 +205,12 @@ def handle_progress(transmitted, pending): logging.debug('%i of %i bytes transmitted (%.2f%%)' % (transmitted, pending, (transmitted/float(pending))*100)) def send_file(bucket, filename): - if bucket.get_key(filename): - logging.error('Duplicate filename %s! I hope that is OK.' % filename) + basefilename = os.path.basename(filename) + if bucket.get_key(basefilename): + logging.error('Duplicate filename %s! I hope that is OK.' % basefilename) k = MyKey(bucket) - k.key = os.path.basename(filename) - logging.info('Uploading %s...' % os.path.basename(filename)) + k.key = basefilename + logging.info('Uploading %s...' % basefilename) fd = SlowFile(name=filename, mode='rb')