Skip to content

Instantly share code, notes, and snippets.

@MorphyDK
Last active June 16, 2021 14:20
Show Gist options
  • Save MorphyDK/c48b47c770fb760a135fc2c043bbd656 to your computer and use it in GitHub Desktop.
Save MorphyDK/c48b47c770fb760a135fc2c043bbd656 to your computer and use it in GitHub Desktop.
mergerfs version with exclude-file.txt
#!/bin/bash
EXCLUDE=/home/plex/scripts/exclude-file.txt
LOGFILE=/home/plex/logs/rclone-upload.log
FROM=/home/plex/move
TO=Googlecrypt:/
if pidof -o %PPID -x "rclone-upload.sh"; then
exit 1
fi
# CHECK FOR FILES IN FROM FOLDER THAT ARE OLDER THAN 15 MINUTES
if find $FROM* -type f -mmin +15 | read
then
start=$(date +'%s')
echo "$(date "+%d.%m.%Y %T") Rclone upload started" | tee -a $LOGFILE
# MOVE FILES OLDER THAN 15 MINUTES
rclone move "$FROM" "$TO" -v --drive-chunk-size=32M --delete-empty-src-dirs --transfers=5 --bwlimit 25M --checkers=5 --progress --min-age 15m --log-file=$LOGFILE
echo "$(date "+%d.%m.%Y %T") Rclone upload finished in $(($(date +'%s') - $start)) seconds" | tee -a $LOGFILE
fi
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment