You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

20 lines
524 B

#!/usr/bin/env python3
import webdav.client as wc
from webdav.client import WebDavException
from sys import argv
options = {
'webdav_hostname': "https://webdav.yandex.ru/",
'webdav_login': "YANDEX USERNAME",
'webdav_password': "YANDEX PASSWORD"
}
if __name__ == '__main__':
reqfile = argv[1]
try:
client = wc.Client(options)
client.upload_sync(remote_path="ISBackups/%s" % reqfile, local_path="/var/backups/%s" % reqfile)
except WebDavException as we:
print(we, type(we))