Hi. I'm using the Linux version of Rclone and the following script to trigger a move command.
if find $FROM* -type f -mmin +15 | read
From what I understand, the line above will check if there are files in the folder older than 15 minutes. If not, it will exit (without triggering rclone), if there are files older than 15 minutes, it will execute the following Rclone command:
rclone move "$FROM" "$TO" --transfers=20 --checkers=20 --delete-after --min-age 15m --log-file=$LOGFILE
The reason to avoid files younger than 15 minutes is to wait until files are completely extracted to the folder before moving it to the cloud.
It makes sense, but it doesn't work as intended. Because " --min-age" for Rclone is the last modified time. And when extracting a packed file the last modified time of the file will retain the time when the file was originally packed.
So, it will (almost) NEVER be less than 15 minutes.
Is there any way to overcome this problem?
I thought about modifying the script command that checks if there are any files older than 15 minutes.
if find $FROM* -type f -mmin +15 | read
to
if find $FROM* -type f -amin +15 | read
So it will read the last time the file was accessed (which will be when the file was extracted). It works partially. Unfortunately if you are extracting multiple files it will trigger the move command from Rclone based on the first file last accessed time without giving enough time for the last file to be extracted.
Maybe I could overcome this problem allowing Rclone to only transfer one file per time, but I'm not sure which file it will choose first (the file already extracted or partially extracted).
Of course, I wouldn't have this problem if Rclone could read not only modified time, but also accessed time, but I guess it's not possible for now.
So, any ideas of how to solve this problem?
Thanks!