How can I dynamically exclude files from a shell command?
Hoi !
I discovered this great project a few weeks ago, and today I wanted to use Pika under NixOS. The program works very well for what I want to do (thanks Borg), except that I had to add a lot of entries to the list of files and folders to exclude.
The reason is that under NixOS (and with home-manager), we already have a reproducible system from a configuration file that doesn't need to be saved. But my issue here is that my Home folder contains lots of small files pointing to the /nix/store directory.
I searched the internet for a solution to prevent Pika / Borg from saving all these small symlinks in the archives, and the only one I found would be to run a command beforehand to scan all my symlinks and determine whether or not they point to /nix/store to copy them or not.
However, for now, I have no idea how to execute a command that manipulates the list of excluded files. I came across ticket #133 (closed) discussing possible support for the Borg exclusion file, but the ticket was resolved with the introduction of regular expressions (which is very good).
Is there a way for me to make a link between a pre-backup command and Pika's exclusion list (because I now know that for Pika's progress, we need to know which files to exclude), or should I propose a feature idea that allows using the stdout of a program to manipulate the exclusion list before a backup?