backup dropbox and googledrive problems fixed.

This commit is contained in:
Akhilesh Darjee 2013-03-20 13:47:17 +05:30
parent 3abf67cf5e
commit ba9ecaeef7
2 changed files with 2 additions and 2 deletions

View File

@ -115,7 +115,7 @@ def upload_file_to_dropbox(filename, folder, dropbox_client):
except rest.ErrorResponse, e: except rest.ErrorResponse, e:
pass pass
else: else:
response = dropbox_client.put_file(folder + "/" + os.path.basename(filename), f, overwrite=True) response = dropbox_client.put_file(os.path.join(folder, os.path.basename(filename)), f, overwrite=True)
if __name__=="__main__": if __name__=="__main__":
backup_to_dropbox() backup_to_dropbox()

View File

@ -74,7 +74,7 @@ def backup_to_gdrive():
for filename in os.listdir(path): for filename in os.listdir(path):
found = False found = False
filepath = os.path.join(path, filename) filepath = os.path.join(path, filename)
ext = filepath.split('.')[-1] ext = filename.split('.')[-1]
size = os.path.getsize(filepath) size = os.path.getsize(filepath)
if ext == 'gz' or ext == 'gzip': if ext == 'gz' or ext == 'gzip':
mimetype = 'application/x-gzip' mimetype = 'application/x-gzip'