What is the use case for folder actions? How to use them correctly?

Hi everybody.

First of all, I am using the web interface.

I feel a bit lost here. What is the use case for folder actions? How to use them correctly?

Let’s assume I have the following directory I want to backup:

/data/
  --.kopiaignore
  --documents/
       --stuff-i-want-to-ignore/
         -ignore-me-a.txt
         -ignore-me-b.txt
	--a.txt
	--b.txt
	--c.txt
  --pictures/
       --stuff-i-want-to-ignore/
         -ignore-me-1.jpg
         -ignore-me-2.jpg
	--1.jpg
	--2.jpg
	--3.jpg

.kopiaignore file content:

/documents/stuff-i-want-to-ignore/
/pictures/stuff-i-want-to-ignore/

If I a define a before-snapshot action and a before-folder action in the /data path policy, both actions are being executed exactly once with KOPIA_SOURCE_PATH=/data.

I would expect/hope that the before-folder action would be called for each “individual folder”:

  • /data
  • /data/documents
  • /data/pictures

That way I could perform preparation tasks depending on the subdirectory that is being backed up.

If I create a new policy with target path /data/documents and add a before-folder action, it will be executed when backing up /data. But this also creates a new snapshot for /data/documents, including /documents/stuff-i-want-to-ignore/* in the backed up files, since the kopiaignore file is located in the root directory /data.

This doesn’t seem right to me. Why can’t I have a policy for /data/documents without having a corresponding snapshot?