# CHECK FOR FILES IN FROM FOLDER THAT ARE OLDER THEN 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 THEN 15 MINUTES**
** rclone move "$FROM" "$TO" --transfers=4 --checkers=4 --delete-empty-src-dirs --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
Here is my "crontab" format:
# Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task will be run # and what command to run for the task # # To define the time you can provide concrete values for # minute (m), hour (h), day of month (dom), month (mon), # and day of week (dow) or use '*' in these fields (for 'any').# # Notice that tasks will be started based on the cron's system # daemon's notion of time and timezones. # # Output of the crontab jobs (including errors) is sent through # email to the user the crontab file belongs to (unless redirected). # # For example, you can run a backup of all your user accounts # at 5 a.m every week with: # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/ # # For more information see the manual pages of crontab(5) and cron(8) # # m h dom mon dow command
You can use three backtics to setup a block that is code by putting them at the start of a line and at the end.
Something like
script here
In cron jobs, you want to use full paths like /usr/bin/rclone. You are double dipping on commands too so I'd remove the find and just use the rclone min-age if that is what you are going for.
Try running the command rclone move with --dry-run with on variables and just put the info in and see what it does so like:
2019/07/18 18:40:51 INFO : Google drive root ':Rclone/TVShows/All Shows': Modify window is 1ms
2019/07/18 18:40:51 ERROR : : error reading source directory: directory not found
2019/07/18 18:40:51 INFO : Google drive root ':Rclone/TVShows/All Shows': Waiting for checks to finish
2019/07/18 18:40:51 INFO : Google drive root ':Rclone/TVShows/All Shows': Waiting for transfers to finish
2019/07/18 18:40:51 ERROR : Attempt 1/3 failed with 1 errors
2019/07/18 18:40:52 ERROR : : error reading source directory: directory not found
2019/07/18 18:40:52 INFO : Google drive root ':Rclone/TVShows/All Shows': Waiting for checks to finish
2019/07/18 18:40:52 INFO : Google drive root ':Rclone/TVShows/All Shows': Waiting for transfers to finish
2019/07/18 18:40:52 ERROR : Attempt 2/3 failed with 1 errors
2019/07/18 18:40:52 ERROR : : error reading source directory: directory not found
2019/07/18 18:40:52 INFO : Google drive root ':Rclone/TVShows/All Shows': Waiting for checks to finish
2019/07/18 18:40:52 INFO : Google drive root ':Rclone/TVShows/All Shows': Waiting for transfers to finish
2019/07/18 18:40:52 ERROR : Attempt 3/3 failed with 1 errors
2019/07/18 18:40:52 INFO :
Transferred: 0 Bytes (0 Bytes/s)
Errors: 1
Checks: 0
Transferred: 0
Elapsed time: 1.8s
I am wondering if there is a difference in rclone and rclone browser? I have Rclone Browser installed. Before they reloaded my seedbox I had both installed.
I think I finally figured it out. In the crontab I put "root" in and the crontab is working now. Files are being moved because on my seedbox their disappearing.