Skip to content

Instantly share code, notes, and snippets.

@trapexit
Created June 21, 2019 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trapexit/e9fbf3c848fd0840cc7694a27bff4629 to your computer and use it in GitHub Desktop.
Save trapexit/e9fbf3c848fd0840cc7694a27bff4629 to your computer and use it in GitHub Desktop.
script for simplifying backup with rclone
#!/bin/bash
USERAGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0"
TARGET="${1}"
path="${2}"
backup_dir="${TARGET}:archive/$(date +%Y)/$(date +%F_%T)/${path}"
rclone \
--checkers=3 \
--tpslimit=3 \
--transfers=3 \
--retries=128 \
--retries-sleep=1m \
--drive-chunk-size=32M \
--progress \
--stats=1s \
--backup-dir="${backup_dir}" \
--fast-list \
--user-agent="${USERAGENT}" \
sync \
${path} \
${TARGET}:${path}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment