What I’m trying to do and why
I have a repo setup for an offline backup to a drive that’s only occasionally connected to my computer. By using a before_backup command like:
findmnt /run/media/rofer/OfflineBackup > /dev/null || exit 75
I’m able to use borgmatic with or without this device connected and most things work fine. However, whenever I run
borgmatic list without this drive connected I get an error complaining it couldn’t be found.
I understand why it wouldn’t make sense for my before_backup command to run during
borgmatic list, but it would be nice to have a similar way for a configured command to be able to check if the drive is connected. In the simplest case there could just be a before_list command.
Better still would be some kind of before_use command which runs before any command would look for the repo like check, backup, and list. That way I could put my findmnt command in one place and have all of these commands work as expected.
If something like my before_use idea would be acceptable I can probably find the time to implement it.
borgmatic version: 1.5.1
sudo borgmatic --version or
sudo pip show borgmatic | grep ^Version
borgmatic installation method: Fedora 31 package
Borg version: borg 1.1.11
sudo borg --version
Python version: Python 3.7.7
operating system and version: Fedora 31 (amd64)