Script for backup files to Yandex Disk.
Script usage YaDisk. Is a Yandex.Disk REST API client library YaDisk library
To get your access_token
:
- Register your app at Yandex
- Be sure to check 'Yandex.Disk permits'
- Be sure to check 'Client for development' (it will set https://oauth.yandex.ru/verification_code?dev=True as
Callback URI
)
- Get access token https://oauth.yandex.ru/authorize?response_type=token&client_id=YOUR_APP_ID
- Get your access token from redirect url (right from the browser, it will be one of parameters)
- Download & Install Python 3.12 Download Python
- Install yadisk lib:
pip install yadisk
- Install yadisk lib:
pip install requests
python ./yaDisk_sync.py [-h] [-d DAYS] [-r] token source destination
positional arguments:
token Access token
source Source path
destination Destination path
options:
-h, --help show this help message and exit
-d DAYS, --days DAYS Lifetime daily backups, days count (int) (Default 45)
-r, --recursive Recursive upload files
python .\yaDisk_sync.py "token" "C:\\Backup" "backup" -d 14
python ./yaDisk_sync.py "token" "/home/user/Backup" "backup" -d 14