Last active
August 17, 2022 12:23
-
-
Save MorphyDK/2b2ade81d20b6c4ad8cc1efc5eb9407a to your computer and use it in GitHub Desktop.
Rclone upload script
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 #) | |
# * * * * * /home/plex/scripts/rclone-upload.cron >/dev/null 2>&1 | |
# modify line 20 config file location | |
if pidof -o %PPID -x "rclone-upload.sh"; then | |
exit 1 | |
fi | |
LOGFILE="/home/plex/logs/rclone-upload.log" | |
FROM="/home/plex/move" | |
TO="Googlecrypt:/" | |
# CHECK FOR FILES IN FROM FOLDER THAT ARE OLDER THAN 15 MINUTES | |
if find $FROM* -type f -mmin +15 | read | |
then | |
echo "$(date "+%d.%m.%Y %T") RCLONE UPLOAD STARTED" | tee -a $LOGFILE | |
# MOVE FILES OLDER THAN 15 MINUTES | |
/usr/bin/rclone move -v --config=/home/plex/.config/rclone/rclone.conf $FROM $TO --transfers=5 --checkers=5 --delete-empty-src-dirs --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
Rclone upload script for Gdrive.
If you want to use mergerfs - my setup adds an extra folder to /home/plex/move , so replace media folder with move .