Feature Request: add option to backup relative paths #431
Labels
No labels
blocked
breaking
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 a new issue
No description provided.
Delete branch "%!s()"
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_pathsthat will firstchdirto the directory listed insource_directoriesand 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_pathsthough, what do you think of an option called something likeworking_directorythat contains a path for borgmatic to change directory to before/after backups? Then, you'd be able to list onesource_directoriesentry as./or even multiplesource_directoriesrelative paths likefooandbar. 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_directorydirective 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_directoryoption. This will be part of the next borgmatic release.Released in borgmatic 1.5.24.