Combining yunohost's backup tool, restic, and Backblaze for daily snapshot backups

Hello!

I’ve looked at a few different threads, and I’ve landed on using restic to create backups and save them to Backblaze.

I found this link in another thread, and I’ve successfully used a modified backup script to sync whatever backups were in my /home/yunohost.backup/archives/ at the time:

#!/bin/bash
set -euo pipefail

source ~/.restic/env.bash

restic backup /home/yunohost.backup/archives --tag yunohost
restic backup /home/grahamalama/ --tag home

Now, I want to automate:

  • running yunohost backup create
  • running ~/.restic/backup

And I’m not sure of a few things:

  • should I run both of those tasks as separate cron jobs? Or, is this a situation where I’d use the backup tool’s hook system so that I’d only run yunohost backup create as a scheduled job, which would then call ~/.restic/backup somehow? I’m having trouble making good use of the docs on those hooks.

  • What “layer” of this system (ynh, restic, Backblaze) should handle the incremental nature of these backups? IIUC, restic will create incremental snapshots on a directory, so I think I’ll want to:

    • create a daily backup with ynh and name it something like daily_backup, overwriting the previous day’s backup each time
    • select Keep only the last version of the file in the Backblaze bucket
    • use various restic options to handle backup settings like how many versions to keep and how long to keep the versions