1、安装
1 | [root@VM-12-16-centos backup]# rclone --version |
2、配置 Webdav
1 | vim /root/~/.config/rclone/rclone.conf |
3、挂载本地并配置开机自启
1 | vim /etc/systemd/system/rclone.service |
4、同步目录
1 | rclone -P --ignore-existing -u -v -P --transfers=10 --ignore-errors --buffer-size=200M --check-first --checkers=10 sync ./backup/ webdav:/backup |
5、解除挂载
1 | fusermount -zu /backup |
6、上传文件
1 | rclone --ignore-existing --use-server-modtime -P --transfers=10 --drive-chunk-size 10M --fast-list --buffer-size=100M --multi-thread-streams 0 copy --check-first --checkers=10 --retries 2 --log-file rclone.log --log-level INFO --timeout 6h --contimeout 6h /backup/$(date +%F)/data.tar.gz webdav:/hkbak/$(date +%F)/ |
7、错误
2023/04/17 15:33:43 Failed to copy: Locked: 423 Locked
rclone delete 00fusheng: –include-from /mnt/yingmeiju.txt -v -P
rclone –ignore-checksum –ignore-size –ignore-existing –use-server-modtime -P –transfers=2 –drive-chunk-size 10M –fast-list –buffer-size=32M –multi-thread-streams 0 copy –check-first –checkers=10 –retries 10 –low-level-retries 1000 –log-file /backup/$(date +%F)/rclone.log –log-level DEBUG –timeout 24h –contimeout 24h –tpslimit 10 /backup/$(date +%F) webdav:/hkbak/$(date +%F)
rclone –ignore-existing –use-server-modtime -P –transfers=10 –drive-chunk-size 10M –fast-list –buffer-size=100M –multi-thread-streams 0 –retries 30 –log-file /backup/$(date +%F)/rclone.log –log-level DEBUG –timeout 12h –contimeout 12h /backup/$(date +%F) webdav:/hkbak/$(date +%F)
curl -s -H ‘Authorization:Basic ZWxhc3RpYzpja3ZAMjAyMA==’ -H ‘Content-Type:application/json’ -XGET ‘http://9.150.197.156:9200/alarm_store2023-04-17/_search' -d ‘{“size”:100,”query”:{“bool”:{“must”:[{“terms”:{“alarm_type”:[“bid_capacity_full”,”bid_capacity_overload”,”bid_have_fatal_errcode”,”bid_availability_very_low”]}},{“terms”:{“region”:[“musicsz”,”musicsh”]}}]}}}’
1 | find /data/ -type d -exec chmod 755 {} \; |