Borgmatic - SynoCommunity/spksrc GitHub Wiki

Installation

Step 1 - Install the Borg Community Package

  1. Log into the web interface

  2. Go to Package Center

  3. Go to the Community tab

  4. Search for Borg

  5. Click Install image

  6. Click Agree when asked about 3rd party software

Step 2 - Create Hidden Shared Folder for Borg Config Files and Certificates

  1. Open the DSM Control Panel and choose Shared Folder
  2. Click Create and enter a name and description. Ensure the following is set:
    • Hide this shared folder in "My Network Places"
    • Hide sub-folders and files from users without permissions
    • Enable Recycle Bin

Step 3 - Create your Borgmatic Config

In the new folder created in Step 2, create your borgmatic.yml config file.

A sample configuration can be found on the official borgmatic website.

To create and edit this file in-browser, you can add the Text Editor package by Synology in Package Center.

You can also create a borgmatic configuration file. Just run the following command in an interactive ssh session or with a scheduled task that you run manually (similar to Step 5 and 6 below).

/usr/local/bin/borgmatic config generate -d /volume1/Backup/fake-data/borgmatic.yml

Step 4 - Upload private keys (optional)

If you have any private keys for uploading files to remote repos, they can be placed in the folder created above.

Step 5 - Add the Backup Task

  1. In DSM Control Panel, go to Task Scheduler.
  2. Click Create > Scheduled Task > User-defined script.
  3. On the General Tab, name the job and ensure that the User is set to root.
  4. On the Schedule Tab, set whatever works for your setup.
  5. On the Task Settings tab, under Run command > User-defined script, add your borgmatic command. Below is a sample command:

/usr/local/bin/borgmatic --config /volume1/Backup/fake-data/borgmatic.yml

  1. Click OK.

Step 6 - Manually Run the job

  1. To test out the task, in DSM Control Panel, go to Task Scheduler.
  2. Click the task you created and then click Run, then OK.

There will not be any visual output, however if you add --log-file /path/to/file.log --log-file-verbosity 2 you can have the output of the command shown in the log file.

Tips

1. Find new config options

To see current config options after an update of borgmatic run borgmatic config generate like

/usr/local/bin/borgmatic config generate -d /volume1/Backup/fake-data/borgmatic-config-new.yml

2. btrfs snapshots

To create btrfs snapshots you need the findmnt tool. You must install the synocli-misc package (SynoCli misc. Tools by SynoCommunity) to have findmnt available.

You find some information in the request Add findmnt for borgmatic, but btrfs support on synology is limited:
Unfortunately, the btfs function in borgmatic is currently on subvolumes, so it is currently somewhat useless on the synology if you want to back up shared folders.

⚠️ **GitHub.com Fallback** ⚠️