Hook scripts before and after repository access & general questions about the repository data use

Hello,

First, thank you for restic, it is an amazing piece of software.

My first question: is it possible to run pre- and post- repository access scripts within rest-server, with the argument of the path that rest-server wants to use? I could do something similar with the UNIX automounter, but I prefer to do it at the application level. If not, the work-around could be that the clients themselves call some sort of REST API before and after the restic backup.

My second question: what part of the existing files of the repository will a new backup read? Imagine I have 1 TB of previous backup snapshot data. I change a few files on the client. I start a new backup snapshot. What files will be read on the repository? None: only some cache files with hashes on the client? Only some cache files with hashes on the rest-server repository (where would those be located?) ? Only the list of files (file names are hashes of the content)? Or will sometimes the content of previous snapshot files be read, too ?

Context: in the 199x, the HSM world was popular (storing data on disk-drives and archiving on tape or WORM autochangers). Some data was immediately accessible (online), some data was accessible with a delay (minutes), some data was cold (days to access it).

I would like to see if the above concept could be applied to restic, and specifically rest-server, using a combination of hard drives arrays that can be switched on and off, and possibly LTO-8 autochangers, migrating away rarely used data on offline storage.

Obviously, from time to time, the data would need to be checked also on offline storage, but the fact that the file names are hashes of the content of the files makes it possible to verify it without restic (I already do that on the restic backups that I copy with rsync).

What do you think?

Thank your for your input!