l3uddz / cloudplow

Automatic rclone remote uploader, with support for multiple remote/folder pairings. UnionFS Cleaner functionality: Deletion of UnionFS whiteout files and their corresponding files on rclone remotes. Automatic remote syncer: Sync between different remotes via a Scaleway server instance, that is created and destroyed at every sync.
GNU General Public License v3.0
339 stars 48 forks source link

Upload when there are any files otherwise don't log/run #72

Open seertenedos opened 4 years ago

seertenedos commented 4 years ago

Describe the problem I would like to use CloudPlow to upload files within a minute of them being created. While you can specify a max file/folder size trigger i need to set that to 0 to capture small text files. It would be great if there was an option to specify that there must also be atleast one file. If you are running every minute to check if there are any files currently the logs end up quite large with just junk runs to say it found no files.

Describe any solutions you think might work Add a config setting for the uploader to add a requirement that there needs to be atleast one file in the folder to upload. Ignore folders when checking. Ideally also have an option to no log the run at all if there was no file found so as to keep the logs and console just having useful info like when actual uploads happen.

Another option may be to use a different trigger for a run. Maybe having the 2 triggers below not just a timer.

  1. A setting to trigger upload on start up. (as in as soon as you start no waiting for timer to trigger)
  2. A setting to trigger based on a file watcher. This could maybe tigger when a file is written to or created or a lock removed with maybe a short delay to give the action time to complete like 10-30 seconds.
efanibi25 commented 3 years ago

I've added a inotify mode: this should only log when a folder is detected as being changed

https://github.com/l3uddz/cloudplow/pull/93