How to exclude file is being written when rclone copy or rclone move executing

So, i want to make loop sh script with rclone move. Is possible to exclude file that being written when rclone move on going? When file finish written, then script loop again, to execute rclone move to move finished file to remote. So, we can keep local disk empty except there is file being written. I hope you guys can understand me, sorry for my bad english.

Maybe show your script - can explain it better. You can use pseudo code to show what you want to achieve.

My script like this

#!/bin/bash

while true; do
    rclone move --checkers 16 "local" "remote"
    sleep 3600
done

I run some program too, to auto archive video or something that write file on "local" folder, because "local" folder disk limited, so i run rclone move like script above that looping every hour to keep "local" disk not full or keep empty. Because program to archive video always run and there is chance running at the same time with script rclone move. So i want exclude that file not finish yet written by archive's program, when script rclone move running to move other files that finish archived.

To keep it simple I would suggest that your program to archive videos writes to different folder and only moves to local when finished.

I see, why im not thinking that
Thank you, i'll try it

But, there is chance when move file from archive result folder to "local", script rclone move running at the same too, is it ok?

Wouldn't --min-age help?

Move operations should be atomic but indeed using --min-age is good idea to be safe.

might try something like

rclone lsf "local" --absolute --files-only --min-age=1h > files.txt
rclone move "local" "remote:"  --files-from=files.txt

on windows, i create a filesystem snapshot and use that as the source for rclone.
not sure exacly the best way to do that on linux.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.