Skip to content

Should create and set "/etc/urbackup/backupfolder" during container start  #3

@kcpants

Description

@kcpants

Right now, the start.sh script creates the backupfolder file in /var/urbackup and populates it with the path to the /media directory (which is mapped into the container) in the following code:

# set default location for backup storage to /media
echo "/media" > /var/urbackup/backupfolder

Some urbackup features also rely on this path being set in /etc/urbackup/backupfolder. In particular, in order to enable btrfs snapshots in urbackup, the backup path must be set in /etc/urbackup/backupfolder as described here (quoted below):

In order to create and remove btrfs snapshots UrBackup installs a setuid executable urbackup_ snapshot_helper. UrBackup also uses this tool to test if cross-device reflinks are possible. Only if UrBackup can create cross-device reflinks and is able to create and destroy btrfs snapshots, is the btrfs mode enabled. urbackup_snapshot_helper needs to be told separately where the UrBackup backup folder is. This path is read from /etc/urbackup/backupfolder. Thus, if /media/backup/urbackup is the folder where UrBackup is saving the paths, following commands would properly create this file:

mkdir /etc/urbackup
echo "/media/backup/urbackup" > /etc/urbackup/backupfolder

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions