Created
July 1, 2020 19:19
-
-
Save 1gg/f2d5b0ce9781f2b69ab6add0fec4fd80 to your computer and use it in GitHub Desktop.
rclone crontab bash
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
#!/bin/bash | |
# RCLONE UPLOAD CRON TAB SCRIPT | |
# Type crontab -e and add line below (without # ) | |
# * * * * * bash /home/user/rclone_schedule.cron >/dev/null 2>&1 | |
if pidof -o %PPID -x "rclone_schedule.cron"; then | |
exit 1 | |
fi | |
LOGFILE="rclone_schedule.cron.log" | |
FROM="mega-temp:/" | |
TO="drive:mega-backup/" | |
echo "$(date "+%d.%m.%Y %T") rclone upload STARTED" | tee -a $LOGFILE | |
# MOVE FILES OLDER THEN 5 MINUTES | |
rclone move $FROM $TO --progress --log-level INFO --min-size 50M --transfers=1 --log-file=$LOGFILE | |
echo "$(date "+%d.%m.%Y %T") rclone upload ENDED" | tee -a $LOGFILE | |
fi | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment