#1125707 postinst: "find: ‘/etc/borgmatic’: No such file or directory"

#1125707#5
Date:
2026-01-16 11:02:56 UTC
From:
To:
Hi,

during package install I noticed an error from the borgmatic package:

    Setting up borgmatic (2.0.11-2)…
    find: ‘/etc/borgmatic’: No such file or directory

The error probably comes from line 9 of borgmatic.postinst:

  if [ "$1" = "configure" ]; then
      if find /etc/borgmatic -maxdepth 1 -type f -name "*.yaml" -print -quit | grep -q .; then
          for i in /etc/borgmatic/*.yaml; do
              # [ … run config file migration … ]
          done
      fi
  fi

I find unnecessary error output during package install and upgrade irritating,
because I always suspect that there is something wrong that I have to fix (even
though in this case everything was fine, I obviously just didn't have any config
files that needed migrating when I installed the package).

The script could be improved here by adding an additional check
'[ -d /etc/borgmatic ] && ' to the 'if' call, or adding an empty /etc/borgmatic
directory to the package.

Cheers,

 - Roland