Projekt

Allgemein

Profil

MailCow » Historie » Version 3

Jeremias Keihsler, 31.01.2023 19:36

1 1 Jeremias Keihsler
h1. MailCow
2
3 2 Jeremias Keihsler
h2. Backup-Mailserver
4
5
interesting article covering that topic
6
https://autoize.com/backup-mx-configuration-for-mailcow/
7
8 3 Jeremias Keihsler
h3. Backup
9 1 Jeremias Keihsler
10
taken from https://mailcow.github.io/mailcow-dockerized-docs/b_n_r_backup/
11
12
create backup-target-location
13
14
<pre><code class="shell">
15
mkdir /mnt/mailcow_backups
16
</code></pre>
17
18
create daily-backup-script @/etc/cron.daily/mailcow_backup.sh@
19
<pre><code class="shell">
20
#!/bin/sh
21
22
# Backup mailcow data
23
# https://mailcow.github.io/mailcow-dockerized-docs/b_n_r_backup/
24
25
set -e
26
27
OUT="$(mktemp)"
28
export MAILCOW_BACKUP_LOCATION="/mnt/mailcow_backups"
29
SCRIPT="/opt/mailcow-dockerized/helper-scripts/backup_and_restore.sh"
30
PARAMETERS="backup all"
31
OPTIONS="--delete-days 30"
32
33
# run command
34
set +e
35
"${SCRIPT}" ${PARAMETERS} ${OPTIONS} 2>&1 > "$OUT"
36
RESULT=$?
37
38
if [ $RESULT -ne 0 ]
39
    then
40
            echo "${SCRIPT} ${PARAMETERS} ${OPTIONS} encounters an error:"
41
            echo "RESULT=$RESULT"
42
            echo "STDOUT / STDERR:"
43
            cat "$OUT"
44
fi
45 3 Jeremias Keihsler
</code></pre>
46
47
48
h2. Debug
49
50
h3. logs
51
52
in-memory logs are sometimes not enough ...
53
find @mailcow.conf@, start in the directory
54
55
<pre><code class="shell">
56
docker compose logs
57 1 Jeremias Keihsler
</code></pre>