Published on Oct 18 2021 in Backup Directadmin

The plugin provides UI for managing local and remote Borg backups on shell-less and shell-equipped DirectAdmin accounts.

Features

See demo screencast below.

Prerequisites

As prerequsites you should have Borg Backup and Perl’s JSON module.

CentOS 7 and 8

yum -y install borgbackup perl-JSON perl-JSON-PP

Debian 10

apt -y install borgbackup libjson-perl libjson-pp-perl

Plugin installation

You will receive plugin download URL in your license email. Now you can install the plugin.

Then (still as user admin) check plugin’s Config page to see if everything looks good (green). After you drop borg.lic into plugin’s directory additional lines with licence info will appear.

Plugin demo

Notes

  1. You can use daborgenv to facilitate setting borg variables when using command line. Example:
[[email protected] ~]$ daborgenv
*** AVAILABLE PROFILES:
local1_r3
local_databases
local_db2
local_db3
local_t1
remote_us

The script should be sourced like this:
. daborgenv [PROFILE_NAME]
[[email protected] ~]$ . daborgenv local1_r3
export BORG_REPO=/home/admin/.da-borg/repos/r3
export BORG_PASSPHRASE=5cccccc569511d88ccccccd4e20d99cd
[[email protected] ~]$ borg info
Repository ID: bb5d4bdf8052222ad4bfff1b2866666666666928fbd09a8745bbe5f56bed11c7
Location: /home/admin/.da-borg/repos/r3
Encrypted: Yes (authenticated BLAKE2b)
Cache: /home/admin/.cache/borg/bb5d4bdf8052233ad4bfff1b33333333a6555928fbd09a8745bbe5f56bed11c7
Security dir: /home/admin/.config/borg/security/bb5d4bdf8052233ad444444444444756a6555928fbd09a8745bbe5f56bed11c7
------------------------------------------------------------------------------
                       Original size      Compressed size    Deduplicated size
All archives:               40.23 MB              7.15 MB              2.65 MB

                       Unique chunks         Total chunks
Chunk index:                     430                 1582
  1. To add your language, copy existing language in /usr/local/directadmin/plugins/borg/lang to a new directory named according to your language and translate strings inside messages.po. To translate menu follow instructions in HOWTO file in lang directory.

  2. Pre and post backup scripts can be used to dump databases. You can find tested examples in /usr/local/directadmin/plugins/borg/bin directory and share them with your users.

  3. To exclude Borg repo from being backed up by DirectAdmin (this may take time and create really big tarballs) run: echo '.da-borg' >> ~/.backup_exclude_paths assuming you are using default repo location.

Feel free to discuss additional features below or by using the form on plugin’s Config page.