Last active
February 24, 2019 06:23
-
-
Save gallo-s-chingon/0d2fcdf6aa8938be77db90dc587dcc69 to your computer and use it in GitHub Desktop.
rclone cron script to copy series to Gdrive series folder
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 # ) | |
# * * * * * root /home/gallo/.scripts/rcloneSeries.cron >/dev/null 2>&1 | |
if pidof -o %PPID -x "rcloneCine.cron"; then | |
exit 1 | |
fi | |
LOGFILE="/home/logs/upload-m.cron.log" | |
FROM="/home/gallo/files/done/series/" | |
TO="gcc:ser" | |
# CHECK FOR FILES IN FROM FOLDER THAT ARE OLDER THAN 15 MINUTES | |
if find $FROM* -type f -mmin +5 | read | |
then | |
echo "$(date "+%d.%m.%Y %T") RCLONE UPLOAD STARTED" | tee -a $LOGFILE | |
# COPY FILES OLDER THAN 5 MINUTES | |
rclone copy $FROM $TO -c --no-traverse --transfers=300 --checkers=300 --min-age 5m --log-file=$LOGFILE | |
echo "$(date "+%d.%m.%Y %T") CINE 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