Open kcpants opened 1 year ago
thanks for this, changes included in the image and a new image has been built, please pull down latest and let me know if it works ok for you.
Wow, amazing response time!
I created a new container based on the latest image and confirmed that /etc/urbackup/backupfolder
exists and is populated as expected and that if --cap-add SYS_ADMIN
is set as an extra parameter and /media
is mapped to a single btrfs disk then btrfs snapshots work out of the box:
sh-5.1# urbackup_snapshot_helper test Testing for btrfs... Create subvolume '/media/testA54hj5luZtlorr494/A' Create a snapshot of '/media/testA54hj5luZtlorr494/A' in '/media/testA54hj5luZtlorr494/B' Delete subvolume (commit): '/media/testA54hj5luZtlorr494/A' Delete subvolume (commit): '/media/testA54hj5luZtlorr494/B' BTRFS TEST OK
Thank you!
The fix works for me and probably will work for most people. I did notice that /var/urbackup
is symlinked to /config/urbackup
meaning that /var/urbackup/backupfolder
actually points to /config/urbackup/backupfolder
which lives in the appdata directory and is therefore customizable so if anyone has changed /config/urbackup/backupfolder
to point to a path other than /media
within the container they might still need to use the workaround. Seems unlikely, but to support these folks (if they exist) it may be necessary to make /etc/urbackup/backupfolder
customizable in the future as well.
As mentioned in my comment above, the change in commit 7cf124d is perfect for enabling btrfs snapshots in my urbackup container and it's likely also sufficient for all common urbackup configurations. Feel free to close this issue or leave it open if you'd like to continue tracking making /etc/urbackup/backupfolder
configurable (perhaps by symlinking it to /var/urbackup/backupfolder
?).
Right now, the
start.sh
script creates thebackupfolder
file in/var/urbackup
and populates it with the path to the/media
directory (which is mapped into the container) in the following code:https://github.com/binhex/arch-urbackup/blob/16f5d11e6ba00b22ef226f77ea19b810d369461e/run/nobody/start.sh#L14-L15
Some urbackup features also rely on this path being set in
/etc/urbackup/backupfolder
. In particular, in order to enablebtrfs
snapshots in urbackup, the backup path must be set in/etc/urbackup/backupfolder
as described here (quoted below):It's possible to create this file once the container is running and it will persist through restarts, until a new container image is pulled at which point urbackup becomes unable to use btrfs snapshots and falls back on traditional backups until
/etc/urbackup/backupfolder
is restored.Workaround
The directory and file can be created alongside the container by adding the following line to the post-args field in advanced settings of the docker container (note the leading semicolon)
; docker exec binhex-urbackup bash -c "mkdir -p /etc/urbackup; echo '/media' > /etc/urbackup/backupfolder"