Feature Request: add option to backup relative paths #431
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#431
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 firstchdir
to the directory listed insource_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 likeworking_directory
that contains a path for borgmatic to change directory to before/after backups? Then, you'd be able to list onesource_directories
entry as./
or even multiplesource_directories
relative paths likefoo
andbar
. 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.Thanks to @fabianschilling, this is now implemented as a new
working_directory
option. This will be part of the next borgmatic release.Released in borgmatic 1.5.24.