Feature Request: add option to backup relative paths
What I'm trying to do and why
I use Borgmatic to back up data from a Docker volume. In the borg archive I only want the data inside the Docker volume; however, Borgmatic backs up the files usig absolute paths, so the paths inside the borg archive are, e.g.:
where what I want is simply:
The only way I've found to do this is to use
./ as the source directory in the Borgmatic configuration and then run Borgmatic in the directory that I want to back up. But this feels extremely fragile (if I ever accidentally run it from the wrong directory I will back up something I didn't intend to) and it also means that I'm not actually specifying the source directory in the Borgmatic config file but rather in the crontab/systemd configuration, so my configuration is split up across the system.
Would it be possible to add a new configuration option e.g.
use_relative_paths that will first
chdir to the directory listed in
source_directories and then back up the files within that directory? Of course this would only work if there is only a single source directory listed.
Thanks for making a great and useful piece of software!
Cool idea.. This isn't a use case I had thought of! Instead of
use_relative_paths though, what do you think of an option called something like
working_directory that contains a path for borgmatic to change directory to before/after backups? Then, you'd be able to list one
source_directories entry as
./ or even multiple
source_directories relative paths like
bar. My thinking is that this behavior might be a little more intuitive.. But I'm interested in whether it would solve your use case well.
Yes I think a
working_directory directive actually makes much more sense and that would still address my use case perfectly.
Deleting a branch is permanent. It CANNOT be undone. Continue?