backup dropbox and googledrive problems fixed.
This commit is contained in:
parent
3abf67cf5e
commit
ba9ecaeef7
@ -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()
|
@ -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'
|
||||||
|
Loading…
Reference in New Issue
Block a user