How to do the work after changeNotify

What is the problem you are having with rclone?

I am using rclone to mount the onedrive file and use --poll-interval 5s to listen the file changes.
How can I copy the file changed to somewhere after changeNotify.
Is any commandline arguments can pass? I am using Python subprocess to run rclone and listening the standard output for now.

Run the command 'rclone version' and share the full output of the command.

rclone v1.66.0
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 5.15.146.1-microsoft-standard-WSL2 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.22.1
- go/linking: static
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

OneDrive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone mount onedrive: onedrive/ --read-only --vfs-cache-mode full --vfs-cache-max-age=720h --dir-cache-time 720h --vfs-cache-max-age=720h --poll-interval 5s -vv

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[onedrive]
type = onedrive
client_id = XXX
client_secret = XXX
token = XXX
drive_id = XXX
drive_type = business
### Double check the config for sensitive info before posting publicly

Not entirely sure what you want to do but maybe:

rclone test changenotify remote:

is what you need to monitor and action changes. Check docs for details and extra flags.

If rclone notify a file created or content modified, access the new file. If the file path changed, get the old file path and new file path. If the file deleted, get the file path too.

I use inotify to detect the rclone mounted folder, but failed. I found the topic Inotifywait not detecting file added to rclone mount - Help and Support - rclone forum which tell me the file system dose not support.

I think the rclone polling changenotify maybe can help me, but it only print the filename to stdout, it is diffiult to determine what event fired.

Also I ran the command

rclone test changnotify onedirve: --dump headers,bodies

got the onedrive polling response json, it dosen't tell me the file event type too. (Create/Move/Modify/Delete)

I change to use Python watchdog module to detect the file change, only watchdog.observers.polling.PollingObserver working (with bad performance).

Is rclone any command can get the notify change type and moniter?
like

rclone test changenotify remote: \
    --created program1 %1\
    --modified program2 %1\
    --moved program3 %1 %2\
    --deleted program4 %1
# Only for explaining, not the real commandline.
# this commandline will polling the file change and run the program1/2/3/4 with argument file path, the placeholder %1 mean old file path, %2 mean new file path.

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