Last active
February 24, 2019 06:23
-
-
Save gallo-s-chingon/6c68bba596a30fc47b1d276988495202 to your computer and use it in GitHub Desktop.
rclone copy to Gdrive
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/rcloneCine.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/cine/" | |
TO="gcc:cin" | |
# 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