Created
October 9, 2021 22:47
-
-
Save doob187/eec4e766aef27c7746ce453836e8d5cc to your computer and use it in GitHub Desktop.
backup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/with-contenv bash | |
# shellcheck shell=bash | |
if pidof -o %PPID -x "$0"; then | |
exit 1 | |
fi | |
CONFIG=rclone.conf | |
SRC=server | |
DST=backupserver | |
LOCALPATH=tobackup | |
REMOTEPATH=backup | |
CHECKERS=8 | |
TRANSFER=4 | |
LOGFILE=~/rclone.log | |
BANDWITHLIMIT=50M | |
$(command -v rclone) sync ${SRC}:/${LOCALPATH} ${DST}:/${REMOTEPATH} \ | |
--transfer=${TRANSFER} --checkers=${CHECKERS} \ | |
--bwlimit=${BANDWITHLIMIT} \ | |
--tpslimit=20 --log-file=${LOGFILE} \ | |
--log-level=INFO -vP --track-renames \ | |
--ignore-errors --stats=30s \ | |
--config=${CONFIG} | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment