Is there an option to call callback script if something changed at destination after sync (no callback if nothing changed)?

Hi :slight_smile:

Is it possible to know somehow if files/dirs changed at destionation after sync?
i.e. not every sync ends with changes (rclone may see that nothing changed at cloud drive and not update anything locally), but if there was something changed after sync at local folder - how to know about it?

thanks!

You can see it at the end of log file (“transferred”):

Transferred:   12.151 MBytes
Errors:                 0
Checks:             19295
**Transferred:          111**
Elapsed time:     4m58.2s

Thanks!

But it’s good idea to have some option to script callback if comething changed… :wink:

P.S. Wow, very fast answer! :slight_smile:

You can use a set of batch files and mailsend.exe (are you using windows or unix/linux?) to send you notifications.

:wink:

I’m using rclone (thanks! it’s very cool!) in a Linux shell “while true” loop.
So ofc I can run a script each time after rclone run :slight_smile:

But I think it’s a good option to run callback script from rclone option, for example, rclone -sync -onchanges script.sh

And I have one more question: files appears immediately with their names (but not full contents) during sync, so my another program (remote, can’t be notified) thinks that file already there (but file is only partially downloaded).
Can I set some option for rclone to download file to a temporary location (or with temporary name) and then just immediately move/rename it to appear full contents immediately?

Ok, really would be great to have this option (if there is something similar in rclone, I don’t know)

But you can have the same result doing:

call rclone..........
call script to read log files
call script "if that happens do that"

I really don’t know… Let’s wait for someone else to show up here …

Interesting idea…

I’ve been thinking of making a kind of event log output for rclone which you could send to a file or a pipe. This would have event records in which would essentially be the rclone log in machine readable format, plus other stuff. That would be great for people implementing GUIs, but it would probably be hard work for scripting.

The --on-changes or maybe --on-event idea is interesting. I’d imagine you’d call the script with multiple parameters, the first of which indicates what rclone was doing, the second the status and the third what it was doing it to, eg

  copy start path
  copy finish path
  move done path
  move error path

Or maybe that is too complicated.

What do you think?

Let me give you a modest personal opinion: the beauty of Rclone is its simplicity. Each new feature is also a potential point of failure.

Compare with Duplicati for example: excellent software, but very sophisticated (local databases, etc). Several headaches if you have to do a restore and the databases have corrupted.

Think of the simplicity of rsync …

:slight_smile: I’ve tried to stay away from any sort of state (eg databases) and anything other than a 1:1 mapping of files to remote objects for this very reason…