Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier integration with btrfs snapshots #45

Open
mikeage opened this issue Jun 3, 2024 · 2 comments
Open

Easier integration with btrfs snapshots #45

mikeage opened this issue Jun 3, 2024 · 2 comments

Comments

@mikeage
Copy link

mikeage commented Jun 3, 2024

[I realize that this might be a bit vague, but I'm kinda brainstorming here]

I currently use btrfs for the filesystem on my drives, and back them up with borg from the command line. I'd like to replace my scripts and their cron jobs with the GUI from this plugin, but I can't quite figure out how to make it behave the way I want.

My problem is that I don't actually back up a directory, but rather, I want to back up a snapshot, which will appear as a subdirectory somewhere. My current script runs the following:

btrfs subvolume snapshot -r $BTRFS_ROOT $BTRFS_ROOT/.snapshots/snap
cd $BTRFS_ROOT/.snapshots/snap/

borg create ... ./foo ./bar /baz

cd -
btrfs subvolume delete $BTRFS_ROOT/.snapshots/snap

Where foo and bar are directories within the btrfs snapshot, and baz in this case is outsize. (I can live without baz, or make it a separate archive).

I do the directory change and relative path to not include the snapshot prefix, so that if I need to restore it, I could restore it directly. This is based on borg's suggestion (see https://borgbackup.readthedocs.io/en/stable/faq.html#how-can-i-avoid-unwanted-base-directories-getting-stored-into-archives).

I could restore with --strip-components, but ideally, i like storing what I need. The fact that there's a prefix of /path/to/.snapshots/snap is not something that really belongs in the archive; it's a side effect of borg.

Using the plugin, I could add the snapshotting part as a pre-script / post-script, but I'm at a loss about the relative paths.

Any suggestions for how this could be easier? Would adding an option for a base directory be possible / reasonable? I'm not sure if this has value for non-btrfs filesystems; I don't use ZFS, for example.

@ryecoaaron
Copy link
Member

I guess I could add a text box option that would do the change directory to the path in the text box right before the borg create if the text box had a path in it.

@ryecoaaron
Copy link
Member

I made this change weeks ago and forgot to push the change. 7.0.8 is in the repo now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants