Có gì mới?

Chia sẻ Backup/restore file lên onedrive

Minh Trí

Administrator
Tham gia ngày
03/12/2013
Bài viết
4.387
Địa điểm
Lý Hòa
Tải file này về chép rclone .exe vô ổ C của máy tính (Windows nhé).
:lik rclone-v1.54.1-windows-amd64.zip
Trên linux, gõ:
rclone config
Mã:
Storage> 23
** See help for onedrive backend at: https://rclone.org/onedrive/ **

Microsoft App Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id>
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret>
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n> n
Remote config
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine
y) Yes (default)
n) No
y/n> n
For this to work, you will need rclone available on a machine that has a web browser available.
Execute the following on your machine (same rclone version recommended) :
        rclone authorize "onedrive"
Then paste the result below:
result>
Mở CMD (trên win) chuyển về C:\ rồi gõ:
C:\rclone.exe authorize "onedrive"
Nó sẽ bật trình duyệt và bảo bạn login tài khoản Onedive (trước khi làm login sẵn đi): trên trình duyệt báo:

Success!​

Là được. Quay về CMD copy đoạn code Có dạng này
{"access_token":"e..................................................................09.1604512+07:00"}
<---End paste
Dán vô linux, chọn Y rồi chọn Q (thoát) là được.
Đoạn code để tải lên:
Mã:
echo "Đang upload lên One Drive";
 /usr/sbin/rclone --transfers=1 move $BACKUP_DIR "onedrive:Backup/sql/$TIMESTAMP2/$TIMESTAMP1/$TIMESTAMP/sync" >> /var/log/rclone.log 2>&1
Trong đó, onedrive là tên lúc bạn vừa tạo ở config.
 

Top Bottom