Endeavouros snapshot related issues

I use Clonezilla and Timeshift to back up my system, but now I’m going to change Timeshift to Borg+vorta. but Borg needs to be specified for backups to work.
I know there are many articles about what folders or files need to be backed up for snapshots, but everyone says something different (because they use different distributions), I would like to ask, besides full backups (like Clonezilla), what folders or files need to be backed up for a snapshot backup of endeavouros to ensure that the system is back to normal, can someone help me with a detailed answer?

1 Like

I use borg with borgmatic. Downside is that there is no gui like vorta, upside is that the borgmatic documentation is very good, and the dev is a very helpful guy (and so is the dev of borg, btw). In addition, borgmatic runs as a systemd service, so you can forget about it after some configuration.

I backup my whole / which may be too much. In the config.yaml I set up the following exclude list which is more or less the same list as the timeshift exlucde list. I set up seperate config for my home directory. Here’s a shortened version of this configs:

# cat /etc/borgmatic/config.yaml

# Where to look for files to backup, and where to store those backups.
# See https://borgbackup.readthedocs.io/en/stable/quickstart.html and
# https://borgbackup.readthedocs.io/en/stable/usage/create.html
# for details.
location:
    # List of source directories to backup (required). Globs and
    # tildes are expanded.
    source_directories:
        # - /home
        # - /etc
        # - /var/log/syslog*        
        # - /etc/pacman.d/gnupg
        - /usr/lib/modules
        - /
 
    # Paths to local or remote repositories (required). Tildes are
    # expanded. Multiple repositories are backed up to in
    # sequence. Borg placeholders can be used. See the output of
    # "borg help placeholders" for details. See ssh_command for
    # SSH options like identity file or port. If systemd service
    # is used, then add local repository paths in the systemd
    # service file to the ReadWritePaths list.
    repositories:
        # - user@backupserver:sourcehostname.borg
        # - user@backupserver:{fqdn}
        - /mnt/data/EOSSystem

    # Any paths matching these patterns are excluded from backups.
    # Globs and tildes are expanded. See the output of "borg help
    # patterns" for more details.
    exclude_patterns:
        # - '*.pyc'
        # - /home/*/.cache
        - /boot/efi
        - /dev/
        - /proc/
        - /sys/
        - /media/
        - /mnt/
        - /tmp/
        - /run/
        - /var/run/
        - /var/lock/
        - /var/lib/docker/
        - /var/lib/schroot/
        - /lost+found
        - /timeshift/
        - /timeshift-btrfs/
        - /data/
        - /DATA/
        - /cdrom/
        - /sdcard/
        - /system/
        - /etc/timeshift.json
        - /var/log/timeshift/
        - /var/log/timeshift-btrfs/
        - /swapfile
        - /snap/
        - /root/.thumbnails
        - /root/.cache
        - /root/.dbus
        - /root/.gvfs
        - /root/.local/share/[Tt]rash
        - /home/*/.thumbnails
        - /home/*/.cache
        - /home/*/.dbus
        - /home/*/.gvfs
        - /home/*/.local/share/[Tt]rash
        - /root/.mozilla/firefox/*.default/Cache
        - /root/.mozilla/firefox/*.default/OfflineCache
        - /root/.opera/cache
        - /root/.kde/share/apps/kio_http/cache
        - /root/.kde/share/cache/http
        - /home/*/.mozilla/firefox/*.default/Cache
        - /home/*/.mozilla/firefox/*.default/OfflineCache
        - /home/*/.opera/cache
        - /home/*/.kde/share/apps/kio_http/cache
        - /home/*/.kde/share/cache/http
        - /var/cache/apt/archives/
        - /var/cache/pacman/pkg/
        - /var/cache/yum/
        - /var/cache/dnf/
        - /var/cache/eopkg/
        - /var/cache/xbps/
        - /var/cache/zypp/
        - /var/cache/edb/
        - /root/
        - /home/*/ 
        
# Repository storage options. See
# https://borgbackup.readthedocs.io/en/stable/usage/create.html and
# https://borgbackup.readthedocs.io/en/stable/usage/general.html for
# details.
storage:

    # Passphrase to unlock the encryption key with. Only use on
    # repositories that were initialized with passphrase/repokey
    # encryption. Quote the value if it contains punctuation, so
    # it parses correctly. And backslash any quote or backslash
    # literals as well. Defaults to not set.
    encryption_passphrase: "MyUltraSecretPassphrase"

# Retention policy for how many backups to keep in each category. See
# https://borgbackup.readthedocs.io/en/stable/usage/prune.html for
# details. At least one of the "keep" options is required for pruning
# to work. To skip pruning entirely, run "borgmatic create" or "check"
# without the "prune" action. See borgmatic documentation for details.
retention:
    # Keep all archives within this time interval.
    # keep_within: 3H

    # Number of daily archives to keep.
    keep_daily: 7

    # Number of weekly archives to keep.
    keep_weekly: 4


# Consistency checks to run after backups. See
# https://borgbackup.readthedocs.io/en/stable/usage/check.html and
# https://borgbackup.readthedocs.io/en/stable/usage/extract.html for
# details.
consistency:
    # List of one or more consistency checks to run: "repository",
    # "archives", "data", and/or "extract". Defaults to
    # "repository" and "archives". Set to "disabled" to disable
    # all consistency checks. "repository" checks the consistency
    # of the repository, "archives" checks all of the archives,
    # "data" verifies the integrity of the data within the
    # archives, and "extract" does an extraction dry-run of the
    # most recent archive. Note that "data" implies "archives".
    checks:
        - repository
        - archives

Here’s the home config:

# cat /etc/borgmatic.d/home.yaml

# Where to look for files to backup, and where to store those backups.
# See https://borgbackup.readthedocs.io/en/stable/quickstart.html and
# https://borgbackup.readthedocs.io/en/stable/usage/create.html
# for details.
location:
    # List of source directories to backup (required). Globs and
    # tildes are expanded.
    source_directories:
        - /home
        # - /etc
        # - /var/log/syslog*


    # Any paths matching these patterns are excluded from backups.
    # Globs and tildes are expanded. See the output of "borg help
    # patterns" for more details.
    exclude_patterns:
        # - '*.pyc'
        - /home/*/.thumbnails
        - /home/*/.cache
        - /home/*/.dbus
        - /home/*/.gvfs
        - /home/*/.local/share/[Tt]rash
        - /home/*/.mpd/music
        

# Retention policy for how many backups to keep in each category. See
# https://borgbackup.readthedocs.io/en/stable/usage/prune.html for
# details. At least one of the "keep" options is required for pruning
# to work. To skip pruning entirely, run "borgmatic create" or "check"
# without the "prune" action. See borgmatic documentation for details.
retention:
    # Keep all archives within this time interval.
    # keep_within: 3H
    # Number of daily archives to keep.
    keep_daily: 7

    # Number of weekly archives to keep.
    keep_weekly: 4

    # Number of monthly archives to keep.
    keep_monthly: -1

    # Number of yearly archives to keep.
    # keep_yearly: 1

    # When pruning, only consider archive names starting with this
    # prefix.  Borg placeholders can be used. See the output of
    # "borg help placeholders" for details. Defaults to
    # "{hostname}-". Use an empty value to disable the default.
    # prefix: sourcehostname

# Consistency checks to run after backups. See
# https://borgbackup.readthedocs.io/en/stable/usage/check.html and
# https://borgbackup.readthedocs.io/en/stable/usage/extract.html for
# details.
consistency:
    # List of one or more consistency checks to run: "repository",
    # "archives", "data", and/or "extract". Defaults to
    # "repository" and "archives". Set to "disabled" to disable
    # all consistency checks. "repository" checks the consistency
    # of the repository, "archives" checks all of the archives,
    # "data" verifies the integrity of the data within the
    # archives, and "extract" does an extraction dry-run of the
    # most recent archive. Note that "data" implies "archives".
    checks:
        - repository
        - archives

Instead of backup the whole / you could use a version with only /etc and /var with a hook to create a package list in order to get your system up fast after a fresh install, again in a shortened version:

# cat /etc/borgmatic.d/test/etc.yaml

# Where to look for files to backup, and where to store those backups.
# See https://borgbackup.readthedocs.io/en/stable/quickstart.html and
# https://borgbackup.readthedocs.io/en/stable/usage/create.html
# for details.
location:
    # List of source directories to backup (required). Globs and
    # tildes are expanded.
    source_directories:
        # - /home
        # - /etc
        # - /var/log/syslog*        
        # - /etc/pacman.d/gnupg
        - /etc
        - /var
 
    # Any paths matching these patterns are excluded from backups.
    # Globs and tildes are expanded. See the output of "borg help
    # patterns" for more details.
    exclude_patterns:
        # - '*.pyc'
        # - /home/*/.cache
        - /var/run/
        - /var/lock/
        - /var/lib/docker/
        - /var/lib/schroot/
        - /etc/timeshift.json
        - /var/log/timeshift/
        - /var/log/timeshift-btrfs/
        - /var/cache/apt/archives/
        - /var/cache/pacman/pkg/
        - /var/cache/yum/
        - /var/cache/dnf/
        - /var/cache/eopkg/
        - /var/cache/xbps/
        - /var/cache/zypp/
        - /var/cache/edb/
        

hooks:
    # List of one or more shell commands or scripts to execute
    # before creating a backup, run once per configuration file.
    before_backup:
        - /bin/sh -c '/usr/bin/pacman -Qqe > /etc/pkglist.txt'

2 Likes

@csteinforth Thank you for your reply, I will read it carefully. :heart:

Since English is not my native language, reading a lot can be a barrier. So I prefer vorta, but vorta has the disadvantage that the default program cannot execute root, resulting in many files without permissions. I have to start vorta with root privileges from the command line, but I’m not sure if that would be a problem.

1 Like

I’m wondering if root access is required for these folder backups? Or can they be run directly with user privileges

If you want to backup your own home folder there is no need for root access. You just have to place the config file where it can be read without root access, like this:

$ borgmatic --config /home/me/brogmatic_home.yaml

I see, that means I still need root access to backup system files except for my own home folder. Thanks, I’ll try it.

1 Like

I noticed that your home.yaml does not have the

repositories:
        # - user@backupserver:sourcehostname.borg
        # - user@backupserver:{fqdn}
        - /mnt/data/EOSSystem

home.yaml, don’t you need to set repositories?

I followed your home configuration and the system reported an error when I checked the configuration.I’ve made the changes that need to be made, my own

> sudo validate-borgmatic-config
/etc/borgmatic.d/home.yaml: Error parsing configuration file
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/borgmatic/config/validate.py", line 105, in parse_configuration
    config = load.load_configuration(config_filename)
  File "/usr/lib/python3.9/site-packages/borgmatic/config/load.py", line 20, in load_configuration
    return yaml.load(open(filename))
  File "/usr/lib/python3.9/site-packages/ruamel/yaml/main.py", line 434, in load
    return constructor.get_single_data()
  File "/usr/lib/python3.9/site-packages/ruamel/yaml/constructor.py", line 120, in get_single_data
    node = self.composer.get_single_node()
  File "_ruamel_yaml.pyx", line 706, in _ruamel_yaml.CParser.get_single_node
  File "_ruamel_yaml.pyx", line 724, in _ruamel_yaml.CParser._compose_document
  File "_ruamel_yaml.pyx", line 775, in _ruamel_yaml.CParser._compose_node
  File "_ruamel_yaml.pyx", line 889, in _ruamel_yaml.CParser._compose_mapping_node
  File "_ruamel_yaml.pyx", line 775, in _ruamel_yaml.CParser._compose_node
  File "_ruamel_yaml.pyx", line 891, in _ruamel_yaml.CParser._compose_mapping_node
  File "_ruamel_yaml.pyx", line 904, in _ruamel_yaml.CParser._parse_next_event
ruamel.yaml.parser.ParserError: while parsing a block mapping
  in "/etc/borgmatic.d/home.yaml", line 260, column 6
did not find expected key
  in "/etc/borgmatic.d/home.yaml", line 266, column 7

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/borgmatic/commands/validate_config.py", line 45, in main
    validate.parse_configuration(config_filename, validate.schema_filename())
  File "/usr/lib/python3.9/site-packages/borgmatic/config/validate.py", line 108, in parse_configuration
    raise Validation_error(config_filename, (str(error),))
borgmatic.config.validate.Validation_error: <unprintable Validation_error object>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.9/logging/__init__.py", line 1083, in emit
    msg = self.format(record)
  File "/usr/lib/python3.9/logging/__init__.py", line 927, in format
    return fmt.format(record)
  File "/usr/lib/python3.9/logging/__init__.py", line 663, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.9/logging/__init__.py", line 365, in getMessage
    msg = str(self.msg)
  File "/usr/lib/python3.9/site-packages/borgmatic/config/validate.py", line 59, in __str__
    ) + '\n'.join(format_error(error) for error in self.errors)
  File "/usr/lib/python3.9/site-packages/borgmatic/config/validate.py", line 59, in <genexpr>
    ) + '\n'.join(format_error(error) for error in self.errors)
  File "/usr/lib/python3.9/site-packages/borgmatic/config/validate.py", line 32, in format_error
    if not error.path:
AttributeError: 'str' object has no attribute 'path'
Call stack:
  File "/usr/bin/validate-borgmatic-config", line 33, in <module>
    sys.exit(load_entry_point('borgmatic==1.5.18', 'console_scripts', 'validate-borgmatic-config')())
  File "/usr/lib/python3.9/site-packages/borgmatic/commands/validate_config.py", line 48, in main
    logging.critical(error)
Message: Validation_error('/etc/borgmatic.d/home.yaml', ('while parsing a block mapping\n  in "/etc/borgmatic.d/home.yaml", line 260, column 6\ndid not find expected key\n  in "/etc/borgmatic.d/home.yaml", line 266, column 7',))
Arguments: ()
1 Like

Edit: I ommited the repository part, sorry! Here is the full config:

# Where to look for files to backup, and where to store those backups.
# See https://borgbackup.readthedocs.io/en/stable/quickstart.html and
# https://borgbackup.readthedocs.io/en/stable/usage/create.html
# for details.
location:
    # List of source directories to backup (required). Globs and
    # tildes are expanded.
    source_directories:
        - /home
        # - /etc
        # - /var/log/syslog*

    # Paths to local or remote repositories (required). Tildes are
    # expanded. Multiple repositories are backed up to in
    # sequence. Borg placeholders can be used. See the output of
    # "borg help placeholders" for details. See ssh_command for
    # SSH options like identity file or port. If systemd service
    # is used, then add local repository paths in the systemd
    # service file to the ReadWritePaths list.
    repositories:
        # - user@backupserver:sourcehostname.borg
        # - user@backupserver:{fqdn}
        - /mnt/data/EOSHome

    # Read include/exclude patterns from one or more separate
    # named files, one pattern per line. Note that Borg considers
    # this option experimental. See the output of "borg help
    # patterns" for more details.
    # patterns_from:
        # - /etc/borgmatic/patterns

    # Any paths matching these patterns are excluded from backups.
    # Globs and tildes are expanded. See the output of "borg help
    # patterns" for more details.
    exclude_patterns:
        # - '*.pyc'
        - /home/*/.thumbnails
        - /home/*/.cache
        - /home/*/.dbus
        - /home/*/.gvfs
        - /home/*/.local/share/[Tt]rash
        - /home/*/.mpd/music
        

# Repository storage options. See
# https://borgbackup.readthedocs.io/en/stable/usage/create.html and
# https://borgbackup.readthedocs.io/en/stable/usage/general.html for
# details.
storage:
    # The standard output of this command is used to unlock the
    # encryption key. Only use on repositories that were
    # initialized with passcommand/repokey encryption. Note that
    # if both encryption_passcommand and encryption_passphrase are
    # set, then encryption_passphrase takes precedence. Defaults
    # to not set.
    # encryption_passcommand: secret-tool lookup borg-repository repo-name

    # Passphrase to unlock the encryption key with. Only use on
    # repositories that were initialized with passphrase/repokey
    # encryption. Quote the value if it contains punctuation, so
    # it parses correctly. And backslash any quote or backslash
    # literals as well. Defaults to not set.
    encryption_passphrase: "MyUltraUltraSecretPassphrase"


# Retention policy for how many backups to keep in each category. See
# https://borgbackup.readthedocs.io/en/stable/usage/prune.html for
# details. At least one of the "keep" options is required for pruning
# to work. To skip pruning entirely, run "borgmatic create" or "check"
# without the "prune" action. See borgmatic documentation for details.
retention:
    # Keep all archives within this time interval.
    # keep_within: 3H

    # Number of secondly archives to keep.
    # keep_secondly: 60

    # Number of minutely archives to keep.
    # keep_minutely: 60

    # Number of hourly archives to keep.
    # keep_hourly: 24

    # Number of daily archives to keep.
    keep_daily: 7

    # Number of weekly archives to keep.
    keep_weekly: 4

    # Number of monthly archives to keep.
    keep_monthly: -1

    # Number of yearly archives to keep.
    # keep_yearly: 1

    # When pruning, only consider archive names starting with this
    # prefix.  Borg placeholders can be used. See the output of
    # "borg help placeholders" for details. Defaults to
    # "{hostname}-". Use an empty value to disable the default.
    # prefix: sourcehostname

# Consistency checks to run after backups. See
# https://borgbackup.readthedocs.io/en/stable/usage/check.html and
# https://borgbackup.readthedocs.io/en/stable/usage/extract.html for
# details.
consistency:
    # List of one or more consistency checks to run: "repository",
    # "archives", "data", and/or "extract". Defaults to
    # "repository" and "archives". Set to "disabled" to disable
    # all consistency checks. "repository" checks the consistency
    # of the repository, "archives" checks all of the archives,
    # "data" verifies the integrity of the data within the
    # archives, and "extract" does an extraction dry-run of the
    # most recent archive. Note that "data" implies "archives".
    checks:
        - repository
        - archives

Most likely you missed to uncomment a main section. Maybe you could you post your config here.

1 Like

@csteinforth I’ve got it working and tested it and it backs up, but currently I’ve set the timer according to the official documentation, but it’s been 2 hours and it still hasn’t started backing up, do you know why that is? I’ll post my timer configuration, please help me to see if there is any error.

borgmatic.timer

[Unit]
Description=Run borgmatic backup

[Timer]
OnCalendar=hourly
Persistent=true

[Install]
WantedBy=timers.target

borgmatic.service

[Unit]
Description=borgmatic backup
Wants=network-online.target
After=network-online.target
# Prevent borgmatic from running unless the machine is plugged into power. Remove this line if you
# want to allow borgmatic to run anytime.
ConditionACPower=true

[Service]
Type=oneshot

# Security settings for systemd running as root, optional but recommended to improve security. You
# can disable individual settings if they cause problems for your use case. For more details, see
# the systemd manual: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
LockPersonality=true
# Certain borgmatic features like Healthchecks integration need MemoryDenyWriteExecute to be off.
# But you can try setting it to "yes" for improved security if you don't use those features.
MemoryDenyWriteExecute=no
NoNewPrivileges=yes
PrivateDevices=yes
PrivateTmp=yes
ProtectClock=yes
ProtectControlGroups=yes
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallErrorNumber=EPERM
# Restrict write access
# Change to 'ProtectSystem=strict' and uncomment 'ProtectHome' to make the whole file
# system read-only be default and uncomment 'ReadWritePaths' for the required write access.
# Add local repositroy paths to the list of 'ReadWritePaths' like '-/mnt/my_backup_drive'.
ProtectSystem=strict
# ProtectHome=read-only
ReadWritePaths=-/root/.config/borg -/root/.cache/borg -/root/.borgmatic -/run/media/scvg009/c2/backup/system -/run/media/scvg009/c2/backup/home -/run/media/scvg009/c2/backup

CapabilityBoundingSet=CAP_DAC_READ_SEARCH CAP_NET_RAW

# Lower CPU and I/O priority.
Nice=19
CPUSchedulingPolicy=batch
IOSchedulingClass=best-effort
IOSchedulingPriority=7
IOWeight=100

Restart=no
# Prevent rate limiting of borgmatic log events. If you are using an older version of systemd that
# doesn't support this (pre-240 or so), you may have to remove this option.
LogRateLimitIntervalSec=0

# Delay start to prevent backups running during boot. Note that systemd-inhibit requires dbus and
# dbus-user-session to be installed.
ExecStartPre=sleep 1m
ExecStart=systemd-inhibit --who="borgmatic" --why="Prevent interrupting scheduled backup" /root/.local/bin/borgmatic --verbosity -1 --syslog-verbosity 1

I use systemd timer and systemctl has been set to boot up.

The configuration file I have run sudo validate-borgmatic-config to check it and there is no problem.

# Where to look for files to backup, and where to store those backups.
# See https://borgbackup.readthedocs.io/en/stable/quickstart.html and
# https://borgbackup.readthedocs.io/en/stable/usage/create.html
# for details.
location:
    # List of source directories to backup (required). Globs and
    # tildes are expanded. Do not backslash spaces in path names.
    source_directories:
        - /
        #- /home
        #- /etc
        #- /var/log/syslog*
        #- /home/user/path with spaces

    # Paths to local or remote repositories (required). Tildes are
    # expanded. Multiple repositories are backed up to in
    # sequence. Borg placeholders can be used. See the output of
    # "borg help placeholders" for details. See ssh_command for
    # SSH options like identity file or port. If systemd service
    # is used, then add local repository paths in the systemd
    # service file to the ReadWritePaths list.
    repositories:
        - /run/media/scvg009/c2/backup/system
        #- user@backupserver:sourcehostname.borg
        #- user@backupserver:{fqdn}

    # Stay in same file system (do not cross mount points).
    # Defaults to false. But when a database hook is used, the
    # setting here is ignored and one_file_system is considered
    # true.
    # one_file_system: true

    # Only store/extract numeric user and group identifiers.
    # Defaults to false.
    # numeric_owner: true

    # Store atime into archive. Defaults to true.
    # atime: false

    # Store ctime into archive. Defaults to true.
    # ctime: false

    # Store birthtime (creation date) into archive. Defaults to
    # true.
    # birthtime: false

    # Use Borg's --read-special flag to allow backup of block and
    # other special devices. Use with caution, as it will lead to
    # problems if used when backing up special devices such as
    # /dev/zero. Defaults to false. But when a database hook is
    # used, the setting here is ignored and read_special is
    # considered true.
    # read_special: false

    # Record bsdflags (e.g. NODUMP, IMMUTABLE) in archive.
    # Defaults to true.
    # bsd_flags: true

    # Mode in which to operate the files cache. See
    # http://borgbackup.readthedocs.io/en/stable/usage/create.html
    # for details. Defaults to "ctime,size,inode".
    # files_cache: ctime,size,inode

    # Alternate Borg local executable. Defaults to "borg".
    # local_path: borg1

    # Alternate Borg remote executable. Defaults to "borg".
    # remote_path: borg1

    # Any paths matching these patterns are included/excluded from
    # backups. Globs are expanded. (Tildes are not.) Note that
    # Borg considers this option experimental. See the output of
    # "borg help patterns" for more details. Quote any value if it
    # contains leading punctuation, so it parses correctly.
    # patterns:
    # - R /
    # - '- /home/*/.cache'
    # - + /home/susan
    # - '- /home/*'

    # Read include/exclude patterns from one or more separate
    # named files, one pattern per line. Note that Borg considers
    # this option experimental. See the output of "borg help
    # patterns" for more details.
    # patterns_from:
    # - /etc/borgmatic/patterns

    # Any paths matching these patterns are excluded from backups.
    # Globs and tildes are expanded. Do not backslash spaces in
    # path names. See the output of "borg help patterns" for more
    # details.
    exclude_patterns:
        - /home
        - /proc
        - /sys
        - /tmp
        - /run/media
        # - '*.pyc'
        # - /home/*/.cache
        # - /etc/ssl
        # - /home/user/path with spaces

    # Read exclude patterns from one or more separate named files,
    # one pattern per line. See the output of "borg help patterns"
    # for more details.
    # exclude_from:
    # - /etc/borgmatic/excludes
    # Exclude directories that contain a CACHEDIR.TAG file. See
    # http://www.brynosaurus.com/cachedir/spec.html for details.
    # Defaults to false.
    # exclude_caches: true
    # Exclude directories that contain a file with the given
    # filenames. Defaults to not set.
    # exclude_if_present:
    # - .nobackup
    # If true, the exclude_if_present filename is included in
    # backups. Defaults to false, meaning that the
    # exclude_if_present filename is omitted from backups.
    # keep_exclude_tags: true
    # Exclude files with the NODUMP flag. Defaults to false.
    # exclude_nodump: true
    # Path for additional source files used for temporary internal
    # state like borgmatic database dumps. Note that changing this
    # path prevents "borgmatic restore" from finding any database
    # dumps created before the change. Defaults to ~/.borgmatic
    # borgmatic_source_directory: /tmp/borgmatic

# Repository storage options. See
# https://borgbackup.readthedocs.io/en/stable/usage/create.html and
# https://borgbackup.readthedocs.io/en/stable/usage/general.html for
# details.
#storage:
# The standard output of this command is used to unlock the
# encryption key. Only use on repositories that were
# initialized with passcommand/repokey/keyfile encryption.
# Note that if both encryption_passcommand and
# encryption_passphrase are set, then encryption_passphrase
# takes precedence. Defaults to not set.
# encryption_passcommand: secret-tool lookup borg-repository repo-name

# Passphrase to unlock the encryption key with. Only use on
# repositories that were initialized with
# passphrase/repokey/keyfile encryption. Quote the value if it
# contains punctuation, so it parses correctly. And backslash
# any quote or backslash literals as well. Defaults to not
# set.
#encryption_passphrase: "r114B119"

# Number of seconds between each checkpoint during a
# long-running backup. See
# https://borgbackup.readthedocs.io/en/stable/faq.html
# for details. Defaults to checkpoints every 1800 seconds (30
# minutes).
# checkpoint_interval: 1800
# Specify the parameters passed to then chunker
# (CHUNK_MIN_EXP, CHUNK_MAX_EXP, HASH_MASK_BITS,
# HASH_WINDOW_SIZE). See
# https://borgbackup.readthedocs.io/en/stable/internals.html
# for details. Defaults to "19,23,21,4095".
# chunker_params: 19,23,21,4095
# Type of compression to use when creating archives. See
# http://borgbackup.readthedocs.io/en/stable/usage/create.html
# for details. Defaults to "lz4".
# compression: lz4
# Remote network upload rate limit in kiBytes/second. Defaults
# to unlimited.
# remote_rate_limit: 100
# Directory where temporary files are stored. Defaults to
# $TMPDIR
# temporary_directory: /path/to/tmpdir
# Command to use instead of "ssh". This can be used to specify
# ssh options.  Defaults to not set.
# ssh_command: ssh -i /path/to/private/key
# Base path used for various Borg directories. Defaults to
# $HOME, ~$USER, or ~.
# borg_base_directory: /path/to/base
# Path for Borg configuration files. Defaults to
# $borg_base_directory/.config/borg
# borg_config_directory: /path/to/base/config
# Path for Borg cache files. Defaults to
# $borg_base_directory/.cache/borg
# borg_cache_directory: /path/to/base/cache
# Path for Borg security and encryption nonce files. Defaults
# to $borg_base_directory/.config/borg/security
# borg_security_directory: /path/to/base/config/security
# Path for Borg encryption key files. Defaults to
# $borg_base_directory/.config/borg/keys
# borg_keys_directory: /path/to/base/config/keys
# Umask to be used for borg create. Defaults to 0077.
# umask: 0077
# Maximum seconds to wait for acquiring a repository/cache
# lock. Defaults to 1.
# lock_wait: 5
# Name of the archive. Borg placeholders can be used. See the
# output of "borg help placeholders" for details. Defaults to
# "{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}". If you specify this
# option, you must also specify a prefix in the retention
# section to avoid accidental pruning of archives with a
# different archive name format. And you should also specify a
# prefix in the consistency section as well.
# archive_name_format: '{hostname}-documents-{now}'
# Bypass Borg error about a repository that has been moved.
# Defaults to false.
# relocated_repo_access_is_ok: true
# Bypass Borg error about a previously unknown unencrypted
# repository. Defaults to false.
# unknown_unencrypted_repo_access_is_ok: true
# Additional options to pass directly to particular Borg
# commands, handy for Borg options that borgmatic does not yet
# support natively. Note that borgmatic does not perform any
# validation on these options. Running borgmatic with
# "--verbosity 2" shows the exact Borg command-line
# invocation.
# extra_borg_options:
# Extra command-line options to pass to "borg init".
# init: --make-parent-dirs
# Extra command-line options to pass to "borg prune".
# prune: --save-space
# Extra command-line options to pass to "borg create".
# create: --no-files-cache
# Extra command-line options to pass to "borg check".
# check: --save-space

# Retention policy for how many backups to keep in each category. See
# https://borgbackup.readthedocs.io/en/stable/usage/prune.html for
# details. At least one of the "keep" options is required for pruning
# to work. To skip pruning entirely, run "borgmatic create" or "check"
# without the "prune" action. See borgmatic documentation for details.
retention:
    # Keep all archives within this time interval.
    # keep_within: 3H

    # Number of secondly archives to keep.
    # keep_secondly: 60

    # Number of minutely archives to keep.
    # keep_minutely: 60

    # Number of hourly archives to keep.
    keep_hourly: 24

    # Number of daily archives to keep.
    keep_daily: 7

    # Number of weekly archives to keep.
    keep_weekly: 4

    # Number of monthly archives to keep.
    keep_monthly: 6

    # Number of yearly archives to keep.
    # keep_yearly: 1
    # When pruning, only consider archive names starting with this
    # prefix.  Borg placeholders can be used. See the output of
    # "borg help placeholders" for details. Defaults to
    # "{hostname}-". Use an empty value to disable the default.
    # prefix: sourcehostname

# Consistency checks to run after backups. See
# https://borgbackup.readthedocs.io/en/stable/usage/check.html and
# https://borgbackup.readthedocs.io/en/stable/usage/extract.html for
# details.
consistency:
    # List of one or more consistency checks to run: "repository",
    # "archives", "data", and/or "extract". Defaults to
    # "repository" and "archives". Set to "disabled" to disable
    # all consistency checks. "repository" checks the consistency
    # of the repository, "archives" checks all of the archives,
    # "data" verifies the integrity of the data within the
    # archives, and "extract" does an extraction dry-run of the
    # most recent archive. Note that "data" implies "archives".
    checks:
        - repository
        - archives
    # Paths to a subset of the repositories in the location
    # section on which to run consistency checks. Handy in case
    # some of your repositories are very large, and so running
    # consistency checks on them would take too long. Defaults to
    # running consistency checks on all repositories configured in
    # the location section.
    # check_repositories:
    # - user@backupserver:sourcehostname.borg
    # Restrict the number of checked archives to the last n.
    # Applies only to the "archives" check. Defaults to checking
    # all archives.
    # check_last: 3
    # When performing the "archives" check, only consider archive
    # names starting with this prefix. Borg placeholders can be
    # used. See the output of "borg help placeholders" for
    # details. Defaults to "{hostname}-". Use an empty value to
    # disable the default.
    # prefix: sourcehostname
# Options for customizing borgmatic's own output and logging.
# output:
# Apply color to console output. Can be overridden with
# --no-color command-line flag. Defaults to true.
# color: false

# Shell commands, scripts, or integrations to execute at various
# points during a borgmatic run. IMPORTANT: All provided commands and
# scripts are executed with user permissions of borgmatic. Do not
# forget to set secure permissions on this configuration file (chmod
# 0600) as well as on any script called from a hook (chmod 0700) to
# prevent potential shell injection or privilege escalation.
hooks:
    # List of one or more shell commands or scripts to execute
    # before creating a backup, run once per configuration file.
    before_backup:
        - findmnt /run/media/scvg009/c2 > /dev/null || exit 75

What does systemctl status borgmatic.timersay?

Follow the official documentation and use sudo systemctl enable --now borgmatic.timer, to start.

I am following the official one

SYSTEMD ¶
If you're using systemd instead of cron to run jobs, you can still configure borgmatic to run automatically.

(If you installed borgmatic from Other ways to install, you may already have borgmatic systemd service and timer files. If so, you may be able to skip some of the steps below.)

First, download the sample systemd service file and the sample systemd timer file.

Then, from the directory where you downloaded them:

sudo mv borgmatic.service borgmatic.timer /etc/systemd/system/
sudo systemctl enable --now borgmatic.timer

OK but what ist the status of the timer?

According to the following information, the timer should be activated

 systemctl status borgmatic.timer
● borgmatic.timer - Run borgmatic backup
     Loaded: loaded (/etc/systemd/system/borgmatic.timer; enabled; vendor preset: disabled)
     Active: active (waiting) since Tue 2021-09-28 23:35:21 CST; 1h 45min ago
    Trigger: Wed 2021-09-29 02:00:00 CST; 38min left
   Triggers: ● borgmatic.service

9月 28 23:35:21 box-dfdf systemd[1]: Started Run borgmatic backup.

Please check the status of the service in addition.

> systemctl status borgmatic.service
× borgmatic.service - borgmatic backup
     Loaded: loaded (/etc/systemd/system/borgmatic.service; static)
     Active: failed (Result: exit-code) since Wed 2021-09-29 01:01:01 CST; 31min ago
TriggeredBy: ● borgmatic.timer
   Main PID: 333734 (code=exited, status=1/FAILURE)
        CPU: 111ms

9月 29 01:00:01 box-dfdf systemd[1]: Starting borgmatic backup...
9月 29 01:01:01 box-dfdf systemd-inhibit[333741]: Failed to execute : No such file or directory
9月 29 01:01:01 box-dfdf systemd-inhibit[333734]: /root/.local/bin/borgmatic failed with exit status 1.
9月 29 01:01:01 box-dfdf systemd[1]: borgmatic.service: Main process exited, code=exited, status=1/FAILURE
9月 29 01:01:01 box-dfdf systemd[1]: borgmatic.service: Failed with result 'exit-code'.
9月 29 01:01:01 box-dfdf systemd[1]: Failed to start borgmatic backup.

/root/.local/bin/borgmatic does not have

It is possible that there is a problem with the /root/.local/bin/borgmatic path set inside borgmatic.service, my borgmatic is not in /root/.local/bin, I installed borgmatic using pacman.
I don’t know where borgmatic is installed by pacman