No errors and no backup #853

Closed
opened 2024-04-19 19:25:10 +00:00 by semaf · 9 comments

What I'm trying to do and why

I am running mailcow in docker (its only for docker available) and need to backup the files according the documentation of mailcow
https://docs.mailcow.email/third_party/borgmatic/third_party-borgmatic/

The backup is running without any errors and at least there are some kb files saved instead of over 3GB.

Steps to reproduce

config.yaml file

source_directories:
    - /mnt/source
repositories:
    - path: ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow
      label: rsync
exclude_patterns:
    - '/mnt/source/postfix/public/'
    - '/mnt/source/postfix/private/'
    - '/mnt/source/rspamd/rspamd.sock'

keep_hourly: 24
keep_daily: 7
keep_weekly: 4
keep_monthly: 6

Actual behavior

mailcow:~# borgmatic -v 2
/etc/borgmatic.d/config.yaml: No commands to run for pre-everything hook
BORG_EXIT_CODES=*** borg --version --debug --show-rc
/etc/borgmatic.d/config.yaml: Borg 1.2.8
rsync: Running actions for repository
/etc/borgmatic.d/config.yaml: No commands to run for pre-actions hook
/etc/borgmatic.d/config.yaml: No commands to run for pre-backup hook
rsync: Creating archive
ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Calling mariadb_databases hook function remove_data_source_dumps
ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Removing MariaDB data source dumps
ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Calling mysql_databases hook function remove_data_source_dumps
ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Removing MySQL data source dumps
ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Calling mongodb_databases hook function remove_data_source_dumps
ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Removing MongoDB data source dumps
ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Calling postgresql_databases hook function remove_data_source_dumps
ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Removing PostgreSQL data source dumps
ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Calling sqlite_databases hook function remove_data_source_dumps
ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Removing SQLite data source dumps
ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Calling mysql_databases hook function dump_data_sources
ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Dumping MySQL databases
ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Dumping MySQL database "mailcow" to /root/.borgmatic/mysql_databases/localhost/mailcow
MYSQL_PWD=*** mysqldump --default-character-set=utf8mb4 --add-drop-database --user mailcow --databases mailcow --result-file /root/.borgmatic/mysql_databases/localhost/mailcow
ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Collecting special file paths
BORG_EXIT_CODES=*** borg create --exclude-from /tmp/tmp25d9k9fv --one-file-system --read-special ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic --dry-run --list
BORG_EXIT_CODES=*** borg create --exclude-from /tmp/tmp25d9k9fv --one-file-system --read-special --debug --show-rc ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic
using builtin fallback logging configuration
33 self tests completed in 0.19 seconds
SSH command line: ['ssh', '-p', '23', 'uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de', 'borg', 'serve', '--debug']
Remote: using builtin fallback logging configuration
Remote: 33 self tests completed in 0.09 seconds
Remote: using builtin fallback logging configuration
Remote: Initialized logging system for JSON-based protocol
Remote: Resolving repository path b'/./mailcow'
Remote: Resolved repository path to '/home/mailcow'
Remote: Verified integrity of /home/mailcow/index.33
TAM-verified manifest
security: read previous location 'ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow'
security: read manifest timestamp '2024-04-19T18:36:47.299157'
security: determined newest manifest timestamp as 2024-04-19T18:36:47.299157
security: repository checks ok, allowing access
Creating archive at "ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::mailcow-2024-04-19T20:58:48.112448"
Verified integrity of /root/.cache/borg/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/chunks
Reading files cache ...
Verified integrity of /root/.cache/borg/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/files
security: read previous location 'ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow'
security: read manifest timestamp '2024-04-19T18:36:47.299157'
security: determined newest manifest timestamp as 2024-04-19T18:36:47.299157
security: repository checks ok, allowing access
Processing files ...
Remote: Cleaned up 0 uncommitted segment files (== everything after segment 33).
Remote: Verified integrity of /home/mailcow/hints.33
Remote: check_free_space: few segments, not requiring a full free segment
Remote: check_free_space: calculated working space for compact as 24 bytes
Remote: check_free_space: required bytes 169252, free bytes 867778057728
security: saving state for a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf to /root/.config/borg/security/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf
security: current location   ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow
security: key type           5
security: manifest timestamp 2024-04-19T18:58:49.137740
RemoteRepository: 55.99 kB bytes sent, 4.09 kB bytes received, 12 messages sent
terminating with success status, rc 0
/etc/borgmatic.d/config.yaml: Calling mariadb_databases hook function remove_data_source_dumps
/etc/borgmatic.d/config.yaml: Removing MariaDB data source dumps
/etc/borgmatic.d/config.yaml: Calling mysql_databases hook function remove_data_source_dumps
/etc/borgmatic.d/config.yaml: Removing MySQL data source dumps
/etc/borgmatic.d/config.yaml: Calling mongodb_databases hook function remove_data_source_dumps
/etc/borgmatic.d/config.yaml: Removing MongoDB data source dumps
/etc/borgmatic.d/config.yaml: Calling postgresql_databases hook function remove_data_source_dumps
/etc/borgmatic.d/config.yaml: Removing PostgreSQL data source dumps
/etc/borgmatic.d/config.yaml: Calling sqlite_databases hook function remove_data_source_dumps
/etc/borgmatic.d/config.yaml: Removing SQLite data source dumps
/etc/borgmatic.d/config.yaml: No commands to run for post-backup hook
/etc/borgmatic.d/config.yaml: No commands to run for pre-prune hook
rsync: Pruning archives
BORG_EXIT_CODES=*** borg prune --keep-daily 7 --keep-hourly 24 --keep-monthly 6 --keep-weekly 4 --glob-archives {hostname}-* --debug --show-rc ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow
using builtin fallback logging configuration
33 self tests completed in 0.17 seconds
SSH command line: ['ssh', '-p', '23', 'uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de', 'borg', 'serve', '--debug']
Remote: using builtin fallback logging configuration
Remote: 33 self tests completed in 0.09 seconds
Remote: using builtin fallback logging configuration
Remote: Initialized logging system for JSON-based protocol
Remote: Resolving repository path b'/./mailcow'
Remote: Resolved repository path to '/home/mailcow'
Remote: Verified integrity of /home/mailcow/index.37
TAM-verified manifest
security: read previous location 'ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow'
security: read manifest timestamp '2024-04-19T18:58:49.137740'
security: determined newest manifest timestamp as 2024-04-19T18:58:49.137740
security: repository checks ok, allowing access
Verified integrity of /root/.cache/borg/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/chunks
security: read previous location 'ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow'
security: read manifest timestamp '2024-04-19T18:58:49.137740'
security: determined newest manifest timestamp as 2024-04-19T18:58:49.137740
security: repository checks ok, allowing access
Archive authentication DISABLED.
TAM-verified archive
Remote: Cleaned up 0 uncommitted segment files (== everything after segment 37).
Remote: Verified integrity of /home/mailcow/hints.37
Remote: check_free_space: few segments, not requiring a full free segment
Remote: check_free_space: calculated working space for compact as 64 bytes
Remote: check_free_space: required bytes 169382, free bytes 867778057728
security: saving state for a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf to /root/.config/borg/security/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf
security: current location   ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow
security: key type           5
security: manifest timestamp 2024-04-19T18:58:50.341455
RemoteRepository: 1.35 kB bytes sent, 5.96 kB bytes received, 14 messages sent
terminating with success status, rc 0
/etc/borgmatic.d/config.yaml: No commands to run for post-prune hook
/etc/borgmatic.d/config.yaml: No commands to run for pre-compact hook
rsync: Compacting segments
BORG_EXIT_CODES=*** borg compact --debug --show-rc ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow
using builtin fallback logging configuration
33 self tests completed in 0.16 seconds
SSH command line: ['ssh', '-p', '23', 'uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de', 'borg', 'serve', '--debug']
Remote: using builtin fallback logging configuration
Remote: 33 self tests completed in 0.09 seconds
Remote: using builtin fallback logging configuration
Remote: Initialized logging system for JSON-based protocol
Remote: Resolving repository path b'/./mailcow'
Remote: Resolved repository path to '/home/mailcow'
Remote: Verified integrity of /home/mailcow/index.41
Remote: Cleaned up 0 uncommitted segment files (== everything after segment 41).
Remote: Verified integrity of /home/mailcow/hints.41
Remote: check_free_space: required bytes 545428898, free bytes 867778057728
Remote: Compaction started (threshold is 10%).
Remote: compacting segment 22 with usage count 0 (maybe freeable: 99.99% [54797 bytes])
Remote: compacting segment 31 with usage count 0 (maybe freeable: 98.82% [671 bytes])
Remote: compacting segment 33 with usage count 0 (maybe freeable: 52.94% [9 bytes])
Remote: compacting segment 35 with usage count 0 (maybe freeable: 83.67% [41 bytes])
Remote: compacting segment 36 with usage count 0 (maybe freeable: 98.92% [736 bytes])
Remote: compacting segment 37 with usage count 0 (maybe freeable: 52.94% [9 bytes])
Remote: compacting segment 38 with usage count 0 (maybe freeable: 93.89% [123 bytes])
Remote: dropping DEL for id 1c86aadd6873deafac1ad5394b3eb1a0239931bb79efdd88860d25642e4238ee - seg 38, iti 41, knisi False, spe False, dins False, si []
Remote: dropping DEL for id 6d1e9983b0dfd2d234916c6ebe27ac9a6a23aa28f77dd6cdaa9d5d5d4443a567 - seg 38, iti 41, knisi False, spe False, dins False, si []
Remote: dropping DEL for id 136e91dbf6876df17bcb0bbbaa06ac31609c7565ad38cdb50398817033532ee1 - seg 38, iti 41, knisi False, spe False, dins False, si []
Remote: compacting segment 39 with usage count 0 (maybe freeable: 83.67% [41 bytes])
Remote: compacting segment 40 with usage count 0 (maybe freeable: 98.82% [670 bytes])
Remote: compacting segment 41 with usage count 0 (maybe freeable: 52.94% [9 bytes])
Remote: compacting segment 42 with usage count 0 (maybe freeable: 83.67% [41 bytes])
Remote: compacting segment 44 with usage count 0 (maybe freeable: 52.94% [9 bytes])
Remote: complete_xfer: wrote commit at segment 45
Remote: complete_xfer: deleting unused segment 22
Remote: complete_xfer: deleting unused segment 31
Remote: complete_xfer: deleting unused segment 33
Remote: complete_xfer: deleting unused segment 35
Remote: complete_xfer: deleting unused segment 36
Remote: complete_xfer: deleting unused segment 37
Remote: complete_xfer: deleting unused segment 38
Remote: complete_xfer: deleting unused segment 39
Remote: complete_xfer: deleting unused segment 40
Remote: complete_xfer: deleting unused segment 41
Remote: complete_xfer: deleting unused segment 42
Remote: complete_xfer: deleting unused segment 44
Remote: compaction freed about 56.87 kB repository space.
Remote: compaction completed.
RemoteRepository: 952 B bytes sent, 10.44 kB bytes received, 5 messages sent
terminating with success status, rc 0
/etc/borgmatic.d/config.yaml: No commands to run for post-compact hook
/etc/borgmatic.d/config.yaml: No commands to run for pre-check hook
rsync: Running consistency checks
BORG_EXIT_CODES=*** borg info --json ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow
Reading check time from /root/.borgmatic/checks/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/repository
Skipping repository check due to configured frequency; 29 days, 23:08:35.204771 until next check (use --force to check anyway)
Reading check time from /root/.borgmatic/checks/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/archives/5b39eb3d2ace2c2200255dd92f1565be627b366f3fa7f32ee9113f7fd548afc6
Reading check time from /root/.borgmatic/checks/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/archives/all
Skipping archives check due to configured frequency; 29 days, 23:08:35.204391 until next check (use --force to check anyway)
/etc/borgmatic.d/config.yaml: No commands to run for post-check hook
/etc/borgmatic.d/config.yaml: No commands to run for post-actions hook
/etc/borgmatic.d/config.yaml: No commands to run for post-everything hook

summary:
/etc/borgmatic.d/config.yaml: Loading configuration file
/etc/borgmatic.d/config.yaml: Successfully ran configuration file

Expected behavior

Should backup over 3GB of files.

Directory size:

mailcow:~# du /mnt/source/
90564   /mnt/source/rspamd
12      /mnt/source/crypt
2732    /mnt/source/redis
92      /mnt/source/postfix
3186088 /mnt/source/vmail
3279492 /mnt/source/

Files including subdirectories:

mailcow:/mnt/source# find . -type f | wc -l
14233

According borgmatic info only 5 files have been backed.

Other notes / implementation ideas

Running:

borg create --one-file-system --read-special ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic --dry-run --list

Result:

{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic --dry-run --list
- /etc/borgmatic.d/config.yaml
- /mnt/source/postfix
- /mnt/source/vmail
- /mnt/source/rspamd
- /mnt/source/redis
- /mnt/source/crypt
- /mnt/source
- /root/.borgmatic/checks/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/repository
- /root/.borgmatic/checks/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/archives/5b39eb3d2ace2c2200255dd92f1565be627b366f3fa7f32ee9113f7fd548afc6
- /root/.borgmatic/checks/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/archives
- /root/.borgmatic/checks/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf
- /root/.borgmatic/checks
- /root/.borgmatic/bootstrap/manifest.json
- /root/.borgmatic/bootstrap
- /root/.borgmatic

After backup is the size around 50kb with borgmatic info instead the 3GB.

Archive name: mailcow-2024-04-19T21:02:02.029694
Archive fingerprint: d020ed26ddba05a731e01cb2b7664d70cf065aded44619e8a5e97dcefa11be96
Comment:
Hostname: mailcow
Username: root
Time (start): Fri, 2024-04-19 21:02:02
Time (end): Fri, 2024-04-19 21:02:03
Duration: 0.19 seconds
Number of files: 5
Command line: /usr/local/bin/borg create --exclude-from /tmp/tmpcp_5dqz2 --one-file-system --read-special --debug --show-rc 'ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}' /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic
Utilization of maximum supported archive size: 0%
------------------------------------------------------------------------------
                       Original size      Compressed size    Deduplicated size
This archive:              222.68 kB             53.42 kB             54.67 kB
All archives:              668.03 kB            160.26 kB            164.56 kB
                       Unique chunks         Total chunks
Chunk index:                      11                   15

borgmatic version

1.8.9

borgmatic installation method

Docker Container: latest

Borg version

borg 1.2.8

Python version

Python 3.12.2

Database version (if applicable)

psql (PostgreSQL) 16.2

Operating system and version

NAME="Alpine Linux" ID=alpine VERSION_ID=3.19.1 PRETTY_NAME="Alpine Linux v3.19" HOME_URL="https://alpinelinux.org/" BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"

### What I'm trying to do and why I am running mailcow in docker (its only for docker available) and need to backup the files according the documentation of mailcow https://docs.mailcow.email/third_party/borgmatic/third_party-borgmatic/ The backup is running without any errors and at least there are some kb files saved instead of over 3GB. ### Steps to reproduce config.yaml file ``` source_directories: - /mnt/source repositories: - path: ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow label: rsync exclude_patterns: - '/mnt/source/postfix/public/' - '/mnt/source/postfix/private/' - '/mnt/source/rspamd/rspamd.sock' keep_hourly: 24 keep_daily: 7 keep_weekly: 4 keep_monthly: 6 ``` ### Actual behavior ``` mailcow:~# borgmatic -v 2 /etc/borgmatic.d/config.yaml: No commands to run for pre-everything hook BORG_EXIT_CODES=*** borg --version --debug --show-rc /etc/borgmatic.d/config.yaml: Borg 1.2.8 rsync: Running actions for repository /etc/borgmatic.d/config.yaml: No commands to run for pre-actions hook /etc/borgmatic.d/config.yaml: No commands to run for pre-backup hook rsync: Creating archive ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Calling mariadb_databases hook function remove_data_source_dumps ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Removing MariaDB data source dumps ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Calling mysql_databases hook function remove_data_source_dumps ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Removing MySQL data source dumps ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Calling mongodb_databases hook function remove_data_source_dumps ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Removing MongoDB data source dumps ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Calling postgresql_databases hook function remove_data_source_dumps ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Removing PostgreSQL data source dumps ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Calling sqlite_databases hook function remove_data_source_dumps ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Removing SQLite data source dumps ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Calling mysql_databases hook function dump_data_sources ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Dumping MySQL databases ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Dumping MySQL database "mailcow" to /root/.borgmatic/mysql_databases/localhost/mailcow MYSQL_PWD=*** mysqldump --default-character-set=utf8mb4 --add-drop-database --user mailcow --databases mailcow --result-file /root/.borgmatic/mysql_databases/localhost/mailcow ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow: Collecting special file paths BORG_EXIT_CODES=*** borg create --exclude-from /tmp/tmp25d9k9fv --one-file-system --read-special ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic --dry-run --list BORG_EXIT_CODES=*** borg create --exclude-from /tmp/tmp25d9k9fv --one-file-system --read-special --debug --show-rc ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic using builtin fallback logging configuration 33 self tests completed in 0.19 seconds SSH command line: ['ssh', '-p', '23', 'uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de', 'borg', 'serve', '--debug'] Remote: using builtin fallback logging configuration Remote: 33 self tests completed in 0.09 seconds Remote: using builtin fallback logging configuration Remote: Initialized logging system for JSON-based protocol Remote: Resolving repository path b'/./mailcow' Remote: Resolved repository path to '/home/mailcow' Remote: Verified integrity of /home/mailcow/index.33 TAM-verified manifest security: read previous location 'ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow' security: read manifest timestamp '2024-04-19T18:36:47.299157' security: determined newest manifest timestamp as 2024-04-19T18:36:47.299157 security: repository checks ok, allowing access Creating archive at "ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::mailcow-2024-04-19T20:58:48.112448" Verified integrity of /root/.cache/borg/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/chunks Reading files cache ... Verified integrity of /root/.cache/borg/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/files security: read previous location 'ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow' security: read manifest timestamp '2024-04-19T18:36:47.299157' security: determined newest manifest timestamp as 2024-04-19T18:36:47.299157 security: repository checks ok, allowing access Processing files ... Remote: Cleaned up 0 uncommitted segment files (== everything after segment 33). Remote: Verified integrity of /home/mailcow/hints.33 Remote: check_free_space: few segments, not requiring a full free segment Remote: check_free_space: calculated working space for compact as 24 bytes Remote: check_free_space: required bytes 169252, free bytes 867778057728 security: saving state for a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf to /root/.config/borg/security/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf security: current location ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow security: key type 5 security: manifest timestamp 2024-04-19T18:58:49.137740 RemoteRepository: 55.99 kB bytes sent, 4.09 kB bytes received, 12 messages sent terminating with success status, rc 0 /etc/borgmatic.d/config.yaml: Calling mariadb_databases hook function remove_data_source_dumps /etc/borgmatic.d/config.yaml: Removing MariaDB data source dumps /etc/borgmatic.d/config.yaml: Calling mysql_databases hook function remove_data_source_dumps /etc/borgmatic.d/config.yaml: Removing MySQL data source dumps /etc/borgmatic.d/config.yaml: Calling mongodb_databases hook function remove_data_source_dumps /etc/borgmatic.d/config.yaml: Removing MongoDB data source dumps /etc/borgmatic.d/config.yaml: Calling postgresql_databases hook function remove_data_source_dumps /etc/borgmatic.d/config.yaml: Removing PostgreSQL data source dumps /etc/borgmatic.d/config.yaml: Calling sqlite_databases hook function remove_data_source_dumps /etc/borgmatic.d/config.yaml: Removing SQLite data source dumps /etc/borgmatic.d/config.yaml: No commands to run for post-backup hook /etc/borgmatic.d/config.yaml: No commands to run for pre-prune hook rsync: Pruning archives BORG_EXIT_CODES=*** borg prune --keep-daily 7 --keep-hourly 24 --keep-monthly 6 --keep-weekly 4 --glob-archives {hostname}-* --debug --show-rc ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow using builtin fallback logging configuration 33 self tests completed in 0.17 seconds SSH command line: ['ssh', '-p', '23', 'uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de', 'borg', 'serve', '--debug'] Remote: using builtin fallback logging configuration Remote: 33 self tests completed in 0.09 seconds Remote: using builtin fallback logging configuration Remote: Initialized logging system for JSON-based protocol Remote: Resolving repository path b'/./mailcow' Remote: Resolved repository path to '/home/mailcow' Remote: Verified integrity of /home/mailcow/index.37 TAM-verified manifest security: read previous location 'ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow' security: read manifest timestamp '2024-04-19T18:58:49.137740' security: determined newest manifest timestamp as 2024-04-19T18:58:49.137740 security: repository checks ok, allowing access Verified integrity of /root/.cache/borg/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/chunks security: read previous location 'ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow' security: read manifest timestamp '2024-04-19T18:58:49.137740' security: determined newest manifest timestamp as 2024-04-19T18:58:49.137740 security: repository checks ok, allowing access Archive authentication DISABLED. TAM-verified archive Remote: Cleaned up 0 uncommitted segment files (== everything after segment 37). Remote: Verified integrity of /home/mailcow/hints.37 Remote: check_free_space: few segments, not requiring a full free segment Remote: check_free_space: calculated working space for compact as 64 bytes Remote: check_free_space: required bytes 169382, free bytes 867778057728 security: saving state for a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf to /root/.config/borg/security/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf security: current location ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow security: key type 5 security: manifest timestamp 2024-04-19T18:58:50.341455 RemoteRepository: 1.35 kB bytes sent, 5.96 kB bytes received, 14 messages sent terminating with success status, rc 0 /etc/borgmatic.d/config.yaml: No commands to run for post-prune hook /etc/borgmatic.d/config.yaml: No commands to run for pre-compact hook rsync: Compacting segments BORG_EXIT_CODES=*** borg compact --debug --show-rc ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow using builtin fallback logging configuration 33 self tests completed in 0.16 seconds SSH command line: ['ssh', '-p', '23', 'uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de', 'borg', 'serve', '--debug'] Remote: using builtin fallback logging configuration Remote: 33 self tests completed in 0.09 seconds Remote: using builtin fallback logging configuration Remote: Initialized logging system for JSON-based protocol Remote: Resolving repository path b'/./mailcow' Remote: Resolved repository path to '/home/mailcow' Remote: Verified integrity of /home/mailcow/index.41 Remote: Cleaned up 0 uncommitted segment files (== everything after segment 41). Remote: Verified integrity of /home/mailcow/hints.41 Remote: check_free_space: required bytes 545428898, free bytes 867778057728 Remote: Compaction started (threshold is 10%). Remote: compacting segment 22 with usage count 0 (maybe freeable: 99.99% [54797 bytes]) Remote: compacting segment 31 with usage count 0 (maybe freeable: 98.82% [671 bytes]) Remote: compacting segment 33 with usage count 0 (maybe freeable: 52.94% [9 bytes]) Remote: compacting segment 35 with usage count 0 (maybe freeable: 83.67% [41 bytes]) Remote: compacting segment 36 with usage count 0 (maybe freeable: 98.92% [736 bytes]) Remote: compacting segment 37 with usage count 0 (maybe freeable: 52.94% [9 bytes]) Remote: compacting segment 38 with usage count 0 (maybe freeable: 93.89% [123 bytes]) Remote: dropping DEL for id 1c86aadd6873deafac1ad5394b3eb1a0239931bb79efdd88860d25642e4238ee - seg 38, iti 41, knisi False, spe False, dins False, si [] Remote: dropping DEL for id 6d1e9983b0dfd2d234916c6ebe27ac9a6a23aa28f77dd6cdaa9d5d5d4443a567 - seg 38, iti 41, knisi False, spe False, dins False, si [] Remote: dropping DEL for id 136e91dbf6876df17bcb0bbbaa06ac31609c7565ad38cdb50398817033532ee1 - seg 38, iti 41, knisi False, spe False, dins False, si [] Remote: compacting segment 39 with usage count 0 (maybe freeable: 83.67% [41 bytes]) Remote: compacting segment 40 with usage count 0 (maybe freeable: 98.82% [670 bytes]) Remote: compacting segment 41 with usage count 0 (maybe freeable: 52.94% [9 bytes]) Remote: compacting segment 42 with usage count 0 (maybe freeable: 83.67% [41 bytes]) Remote: compacting segment 44 with usage count 0 (maybe freeable: 52.94% [9 bytes]) Remote: complete_xfer: wrote commit at segment 45 Remote: complete_xfer: deleting unused segment 22 Remote: complete_xfer: deleting unused segment 31 Remote: complete_xfer: deleting unused segment 33 Remote: complete_xfer: deleting unused segment 35 Remote: complete_xfer: deleting unused segment 36 Remote: complete_xfer: deleting unused segment 37 Remote: complete_xfer: deleting unused segment 38 Remote: complete_xfer: deleting unused segment 39 Remote: complete_xfer: deleting unused segment 40 Remote: complete_xfer: deleting unused segment 41 Remote: complete_xfer: deleting unused segment 42 Remote: complete_xfer: deleting unused segment 44 Remote: compaction freed about 56.87 kB repository space. Remote: compaction completed. RemoteRepository: 952 B bytes sent, 10.44 kB bytes received, 5 messages sent terminating with success status, rc 0 /etc/borgmatic.d/config.yaml: No commands to run for post-compact hook /etc/borgmatic.d/config.yaml: No commands to run for pre-check hook rsync: Running consistency checks BORG_EXIT_CODES=*** borg info --json ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow Reading check time from /root/.borgmatic/checks/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/repository Skipping repository check due to configured frequency; 29 days, 23:08:35.204771 until next check (use --force to check anyway) Reading check time from /root/.borgmatic/checks/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/archives/5b39eb3d2ace2c2200255dd92f1565be627b366f3fa7f32ee9113f7fd548afc6 Reading check time from /root/.borgmatic/checks/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/archives/all Skipping archives check due to configured frequency; 29 days, 23:08:35.204391 until next check (use --force to check anyway) /etc/borgmatic.d/config.yaml: No commands to run for post-check hook /etc/borgmatic.d/config.yaml: No commands to run for post-actions hook /etc/borgmatic.d/config.yaml: No commands to run for post-everything hook summary: /etc/borgmatic.d/config.yaml: Loading configuration file /etc/borgmatic.d/config.yaml: Successfully ran configuration file ``` ### Expected behavior Should backup over 3GB of files. Directory size: ``` mailcow:~# du /mnt/source/ 90564 /mnt/source/rspamd 12 /mnt/source/crypt 2732 /mnt/source/redis 92 /mnt/source/postfix 3186088 /mnt/source/vmail 3279492 /mnt/source/ ``` Files including subdirectories: ``` mailcow:/mnt/source# find . -type f | wc -l 14233 ``` According `borgmatic info` only 5 files have been backed. ### Other notes / implementation ideas Running: `borg create --one-file-system --read-special ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic --dry-run --list` Result: ``` {hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic --dry-run --list - /etc/borgmatic.d/config.yaml - /mnt/source/postfix - /mnt/source/vmail - /mnt/source/rspamd - /mnt/source/redis - /mnt/source/crypt - /mnt/source - /root/.borgmatic/checks/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/repository - /root/.borgmatic/checks/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/archives/5b39eb3d2ace2c2200255dd92f1565be627b366f3fa7f32ee9113f7fd548afc6 - /root/.borgmatic/checks/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf/archives - /root/.borgmatic/checks/a29a84fa669f8d08f266c8614a0120dfaa91a32f0d82708ce53e3688be1a55bf - /root/.borgmatic/checks - /root/.borgmatic/bootstrap/manifest.json - /root/.borgmatic/bootstrap - /root/.borgmatic ``` After backup is the size around 50kb with `borgmatic info` instead the 3GB. ``` Archive name: mailcow-2024-04-19T21:02:02.029694 Archive fingerprint: d020ed26ddba05a731e01cb2b7664d70cf065aded44619e8a5e97dcefa11be96 Comment: Hostname: mailcow Username: root Time (start): Fri, 2024-04-19 21:02:02 Time (end): Fri, 2024-04-19 21:02:03 Duration: 0.19 seconds Number of files: 5 Command line: /usr/local/bin/borg create --exclude-from /tmp/tmpcp_5dqz2 --one-file-system --read-special --debug --show-rc 'ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}' /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic Utilization of maximum supported archive size: 0% ------------------------------------------------------------------------------ Original size Compressed size Deduplicated size This archive: 222.68 kB 53.42 kB 54.67 kB All archives: 668.03 kB 160.26 kB 164.56 kB Unique chunks Total chunks Chunk index: 11 15 ``` ### borgmatic version 1.8.9 ### borgmatic installation method Docker Container: latest ### Borg version borg 1.2.8 ### Python version Python 3.12.2 ### Database version (if applicable) psql (PostgreSQL) 16.2 ### Operating system and version NAME="Alpine Linux" ID=alpine VERSION_ID=3.19.1 PRETTY_NAME="Alpine Linux v3.19" HOME_URL="https://alpinelinux.org/" BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
Owner

Thanks for taking the time to file this and provide all the details! My guess at this point is that --one-file-system is causing problems here. Specifically, if /mnt/source/postfix, /mnt/source/vmail, /mnt/source/rspamd, /mnt/source/redis, /mnt/source/crypt reside on different filesystems from /mnt/source, then Borg won't actually traverse those filesystem boundaries and backup the contained files.

Two ways I can think of to verify this theory. First, you can run the dry-run again, but this time without --one-file-system:

borg create --read-special ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic --dry-run --list

If that starts including way more files, then it's pretty clear --one-file-system is the proximate source of the problem.

The second way is to run mount within your borgmatic container and observe whether the various directories in question are mounted as separate filesystems.

Thanks for taking the time to file this and provide all the details! My guess at this point is that `--one-file-system` is causing problems here. Specifically, if `/mnt/source/postfix`, `/mnt/source/vmail`, `/mnt/source/rspamd`, `/mnt/source/redis`, `/mnt/source/crypt` reside on different filesystems from `/mnt/source`, then Borg won't actually traverse those filesystem boundaries and backup the contained files. Two ways I can think of to verify this theory. First, you can run the dry-run again, but this time without `--one-file-system`: `borg create --read-special ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic --dry-run --list` If that starts including way more files, then it's pretty clear `--one-file-system` is the proximate source of the problem. The second way is to run `mount` within your borgmatic container and observe whether the various directories in question are mounted as separate filesystems.
Author

The dry run listed all the files and I started a regular run which had some issues and didnt go further for minutes, stacked on a file after several starts that I interrupted.

borg create --read-special ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic --list

A /etc/borgmatic.d/config.yaml
d /mnt/source/postfix/corrupt
d /mnt/source/postfix/maildrop
d /mnt/source/postfix/lib
d /mnt/source/postfix/private
d /mnt/source/postfix/etc
d /mnt/source/postfix/flush
d /mnt/source/postfix/deferred
A /mnt/source/postfix/public/pickup
^C/mnt/source/postfix/public/pickup: read: [Errno 4] Interrupted system call
E /mnt/source/postfix/public/pickup
A /mnt/source/postfix/public/qmgr
mailcow:/mnt/source/postfix/public# ls -al
total 8
drwx--s---    2 101      103           4096 Apr 19 18:13 .
drwxr-xr-x   20 root     root          4096 Apr  7 22:08 ..
srw-rw-rw-    1 101      103              0 Apr 19 18:13 cleanup
srw-rw-rw-    1 101      103              0 Apr 19 18:13 flush
prw--w--w-    1 101      103              0 Apr 20 09:32 pickup
prw--w--w-    1 101      103              0 Apr 20 09:28 qmgr
srw-rw-rw-    1 101      103              0 Apr 19 18:13 showq
srw-rw-rw-    1 101      103              0 Apr 19 18:13 smtp_sender_cleanup
srw-rw-rw-    1 101      103              0 Apr 19 18:13 watchdog_cleanup
prw--w--w-    1 101      103              0 Apr 20 09:31 watchdog_qmgr

Could be the directory and file rights? According borgmatic documentation is mount to extract, how to use it in a container?

Trying to mount has another issue with modprobe which does not exist in a container

mailcow:/mnt# borgmatic mount --archive latest --mount-point /mnt/backup_mnt/
rsync: Error running actions for repository
Command 'borg mount ssh://uxxxxxx-sub12@uxxxxxx-sub12.your-storagebox.de:23/./mailcow::mailcow-2024-04-20T10:21:26.723750 /mnt/backup_mnt/' returned non-zero exit status 2.
/etc/borgmatic.d/config.yaml: An error occurred

summary:
/etc/borgmatic.d/config.yaml: An error occurred
rsync: Error running actions for repository
fuse: device not found, try 'modprobe fuse' first
Command 'borg mount ssh://uxxxxxx-sub12@uxxxxxx-sub12.your-storagebox.de:23/./mailcow::mailcow-2024-04-20T10:21:26.723750 /mnt/backup_mnt/' returned non-zero exit status 2.

Need some help? https://torsion.org/borgmatic/#issues
The dry run listed all the files and I started a regular run which had some issues and didnt go further for minutes, stacked on a file after several starts that I interrupted. `borg create --read-special ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic --list` ``` A /etc/borgmatic.d/config.yaml d /mnt/source/postfix/corrupt d /mnt/source/postfix/maildrop d /mnt/source/postfix/lib d /mnt/source/postfix/private d /mnt/source/postfix/etc d /mnt/source/postfix/flush d /mnt/source/postfix/deferred A /mnt/source/postfix/public/pickup ^C/mnt/source/postfix/public/pickup: read: [Errno 4] Interrupted system call E /mnt/source/postfix/public/pickup A /mnt/source/postfix/public/qmgr ``` ``` mailcow:/mnt/source/postfix/public# ls -al total 8 drwx--s--- 2 101 103 4096 Apr 19 18:13 . drwxr-xr-x 20 root root 4096 Apr 7 22:08 .. srw-rw-rw- 1 101 103 0 Apr 19 18:13 cleanup srw-rw-rw- 1 101 103 0 Apr 19 18:13 flush prw--w--w- 1 101 103 0 Apr 20 09:32 pickup prw--w--w- 1 101 103 0 Apr 20 09:28 qmgr srw-rw-rw- 1 101 103 0 Apr 19 18:13 showq srw-rw-rw- 1 101 103 0 Apr 19 18:13 smtp_sender_cleanup srw-rw-rw- 1 101 103 0 Apr 19 18:13 watchdog_cleanup prw--w--w- 1 101 103 0 Apr 20 09:31 watchdog_qmgr ``` Could be the directory and file rights? According borgmatic documentation is `mount ` to extract, how to use it in a container? Trying to mount has another issue with modprobe which does not exist in a container ``` mailcow:/mnt# borgmatic mount --archive latest --mount-point /mnt/backup_mnt/ rsync: Error running actions for repository Command 'borg mount ssh://uxxxxxx-sub12@uxxxxxx-sub12.your-storagebox.de:23/./mailcow::mailcow-2024-04-20T10:21:26.723750 /mnt/backup_mnt/' returned non-zero exit status 2. /etc/borgmatic.d/config.yaml: An error occurred summary: /etc/borgmatic.d/config.yaml: An error occurred rsync: Error running actions for repository fuse: device not found, try 'modprobe fuse' first Command 'borg mount ssh://uxxxxxx-sub12@uxxxxxx-sub12.your-storagebox.de:23/./mailcow::mailcow-2024-04-20T10:21:26.723750 /mnt/backup_mnt/' returned non-zero exit status 2. Need some help? https://torsion.org/borgmatic/#issues ```
Owner

That Borg command is likely hanging on qmgr is because --read-special is given and qmgr is a named pipe but isn't excluded (which it would be excluded if run from borgmatic with your current configuration). But what this demonstrates is that the Borg command without --one-filesystem does descend into some of those directories. And therefore --one-filesystem might be causing problems here.

When I was suggesting that you run mount, I wasn't suggesting borgmatic mount or borg mount but rather just mount by itself! That will show you all mounted filesystems in your container and will hopefully indicate whether your sub-directories in /mnt/source are on separate filesystems.

That Borg command is likely hanging on `qmgr` is because `--read-special` is given and `qmgr` is a named pipe but isn't excluded (which it would be excluded if run from borgmatic with your current configuration). But what this demonstrates is that the Borg command without `--one-filesystem` _does_ descend into some of those directories. And therefore `--one-filesystem` might be causing problems here. When I was suggesting that you run `mount`, I wasn't suggesting `borgmatic mount` or `borg mount` but rather just `mount` by itself! That will show you all mounted filesystems in your container and will hopefully indicate whether your sub-directories in `/mnt/source` are on separate filesystems.
Author

I am executing the commands inside the docker container of borgmatic. And the volumes are already mounted. As I have understood, you mean I should backup outside of container over the volumes. That will be another option to do but insecure as there would be access to the file system.

This is the docker-compose.override.yml file, according to Mailcow it should be done that way:

services:
  borgmatic-mailcow:
    image: ghcr.io/borgmatic-collective/borgmatic
    hostname: mailcow
    restart: always
    dns: ${IPV4_NETWORK:-172.22.1}.254
    volumes:
      - vmail-vol-1:/mnt/source/vmail:ro
      - crypt-vol-1:/mnt/source/crypt:ro
      - redis-vol-1:/mnt/source/redis:ro
      - rspamd-vol-1:/mnt/source/rspamd:ro
      - postfix-vol-1:/mnt/source/postfix:ro
      - mysql-socket-vol-1:/var/run/mysqld/
      - borg-config-vol-1:/root/.config/borg
      - borg-cache-vol-1:/root/.cache/borg
      - ./data/conf/borgmatic/etc:/etc/borgmatic.d:Z
      - ./data/conf/borgmatic/ssh:/root/.ssh:Z
    environment:
      - TZ=${TZ}
      - BORG_PASSPHRASE=verylongpassword
    networks:
      mailcow-network:
        aliases:
          - borgmatic

volumes:
  borg-cache-vol-1:
  borg-config-vol-1:

Last option would be to setup Mailcow again and give a try.

I am executing the commands inside the docker container of borgmatic. And the volumes are already mounted. As I have understood, you mean I should backup outside of container over the volumes. That will be another option to do but insecure as there would be access to the file system. This is the docker-compose.override.yml file, according to Mailcow it should be done that way: ``` services: borgmatic-mailcow: image: ghcr.io/borgmatic-collective/borgmatic hostname: mailcow restart: always dns: ${IPV4_NETWORK:-172.22.1}.254 volumes: - vmail-vol-1:/mnt/source/vmail:ro - crypt-vol-1:/mnt/source/crypt:ro - redis-vol-1:/mnt/source/redis:ro - rspamd-vol-1:/mnt/source/rspamd:ro - postfix-vol-1:/mnt/source/postfix:ro - mysql-socket-vol-1:/var/run/mysqld/ - borg-config-vol-1:/root/.config/borg - borg-cache-vol-1:/root/.cache/borg - ./data/conf/borgmatic/etc:/etc/borgmatic.d:Z - ./data/conf/borgmatic/ssh:/root/.ssh:Z environment: - TZ=${TZ} - BORG_PASSPHRASE=verylongpassword networks: mailcow-network: aliases: - borgmatic volumes: borg-cache-vol-1: borg-config-vol-1: ``` Last option would be to setup Mailcow again and give a try.
Author

Update:

I setup freshly Mailcow, removed volumes and run it again. Used borgmatic -v 2 to backup and became the same result. No files has been backed up.

Than gave a try to the command above and it began to backup but stucked again on the file A /mnt/source/postfix/public/pickup

borg create --read-special ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic --list

Update: I setup freshly Mailcow, removed volumes and run it again. Used `borgmatic -v 2` to backup and became the same result. No files has been backed up. Than gave a try to the command above and it began to backup but stucked again on the file `A /mnt/source/postfix/public/pickup` `borg create --read-special ssh://uxxxxxx-sub11@uxxxxxx-sub11.your-storagebox.de:23/./mailcow::{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f} /etc/borgmatic.d/config.yaml /mnt/source /root/.borgmatic --list`
Owner

I am executing the commands inside the docker container of borgmatic. And the volumes are already mounted. As I have understood, you mean I should backup outside of container over the volumes. That will be another option to do but insecure as there would be access to the file system.

Sorry, I think we're talking past each other here! I wasn't suggesting you backup outside of the container. I was only suggesting that you run the plain mount command (without borgmatic or Borg) within the container so we can get an idea of how your filesystems are mounted. Although based on the Docker Compose file you posted, I think it's pretty clear how they're mounted now!

This is the docker-compose.override.yml file, according to Mailcow it should be done that way:

Got it. So it looks like your sub-directories (/mnt/source/vmail, etc.) are indeed mounted separately and therefore I suspect they're showing up within your container as separate filesystems. That means that if your source_directories only contain /mnt/source, borgmatic/Borg will never descend into those sub-directories (as long as --one-filesystem is implicitly in use).

So the solution I think is to replace /mnt/source in source_directories with each of your sub-directories by name. Example:

source_directories:
    - /mnt/source/rspamd
    - /mnt/source/crypt
    - /mnt/source/redis
    - /mnt/source/postfix
    - /mnt/source/vmail

I realize this is less convenient than just specifying /mnt/source, but it's necessary due to the interaction between borgmatic/Borg's use of --one-filesystem and Docker's use of multiple filesystems for the volume mounts.

> I am executing the commands inside the docker container of borgmatic. And the volumes are already mounted. As I have understood, you mean I should backup outside of container over the volumes. That will be another option to do but insecure as there would be access to the file system. Sorry, I think we're talking past each other here! I wasn't suggesting you backup outside of the container. I was only suggesting that you run the plain `mount` command (without borgmatic or Borg) within the container so we can get an idea of how your filesystems are mounted. Although based on the Docker Compose file you posted, I think it's pretty clear how they're mounted now! > This is the docker-compose.override.yml file, according to Mailcow it should be done that way: Got it. So it looks like your sub-directories (`/mnt/source/vmail`, etc.) are indeed mounted separately and therefore I suspect they're showing up within your container as separate filesystems. That means that if your `source_directories` only contain `/mnt/source`, borgmatic/Borg will never descend into those sub-directories (as long as `--one-filesystem` is implicitly in use). So the solution I think is to replace `/mnt/source` in `source_directories` with each of your sub-directories by name. Example: ```yaml source_directories: - /mnt/source/rspamd - /mnt/source/crypt - /mnt/source/redis - /mnt/source/postfix - /mnt/source/vmail ``` I realize this is less convenient than just specifying `/mnt/source`, but it's necessary due to the interaction between borgmatic/Borg's use of `--one-filesystem` and Docker's use of multiple filesystems for the volume mounts.
Owner

I setup freshly Mailcow, removed volumes and run it again. Used borgmatic -v 2 to backup and became the same result. No files has been backed up.

Yeah, you'd need the volumes mounted for borgmatic to be able to find those files. See my answer above about a way to hopefully make things work even with the volumes mounted.

> I setup freshly Mailcow, removed volumes and run it again. Used borgmatic -v 2 to backup and became the same result. No files has been backed up. Yeah, you'd need the volumes mounted for borgmatic to be able to find those files. See my answer above about a way to hopefully make things work even with the volumes mounted.
Author

After 3 days of research it worked. Thank you very much for your time and help. I will link this here to the guys at mailcow.

image

After 3 days of research it worked. Thank you very much for your time and help. I will link this here to the guys at mailcow. ![image](/attachments/f0a37852-f742-4b2f-8729-bf8e49228ca8)
semaf closed this issue 2024-04-20 21:13:52 +00:00
Owner

Awesome, I'm so glad to hear it's working now! Thanks for your patience here—and for passing along the info to the Mailcow devs.

Awesome, I'm so glad to hear it's working now! Thanks for your patience here—and for passing along the info to the Mailcow devs.
witten added the
question / support
label 2024-04-20 21:41:27 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#853
No description provided.