borgmatic

apt-get update && apt-get install borgbackup borgmatic
mkdir /etc/borgmatic/
generate-borgmatic-config --destination /etc/borgmatic/config.yaml
  • on debian 12.4 borgmatic version is 1.7.7 so use old generate-borgmatic-config command
  • make changes to config
    location:
        source_directories:
            - /path/to/directory01
            - /path/to/directory02
        repositories:
            - ssh://<repo>@<repo>.repo.borgbase.com/./repo
    storage:
        encryption_passphrase: "this is a secure passphrase"
        ssh_command: ssh -i /path/to/ssh_key
    retention:
        keep_daily: 7
        keep_weekly: 4
        keep_monthly: 6
        keep_yearly: 1
    consistency:
        checks:
            - name: repository
            - name: archives
            frequency: 1 week
    hooks:
        ntfy:
            topic: borg
            server: https://ntfy.sh
            finish:
                title: $HOSTNAME -> borgbase
                message: borgmatic finished successfully
                priority: min
            fail:
                title: $HOSTNAME -> borgbase
                message: borgmatic failed
                priority: urgent
            states:
                - finish
                - fail

https://torsion.org/borgmatic/