!/bin/bash

check if we are the only local instance
if [[ "`pidof -x $(basename $0) -o %PPID`" ]]; then
        echo "This script is already running with PID `pidof -x $(basename $0) -o %PPID`" >> "${LOGDIR}"
        exit
fi

#rclone sync tdrive:/tv /mnt/user/Series --bwlimit "00:30,10M 07:00,8M 09:00,2M 17:00,512K" --tpslimit 8 --tpslimit-burst 5 --drive-chunk-size 256M --fast-list --drive-#acknowledge-abuse --log-level "INFO" --log-file "/mnt/user/logs/rclone/rclone_sync_ggl_series.log"

rclone copy tdrive:/tv /mnt/user/Series \
--bwlimit "01:00,off 07:00,500k 17:00,0" \
--tpslimit-burst 5 \
--drive-chunk-size 256M \
--fast-list \
--drive-acknowledge-abuse \
--log-level "INFO" \
--log-file "/mnt/user/logs/rclone/rclone_sync_ggl_series.log"
