Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung | |||
content:serverbasics:server-backup [2025/03/28 19:55] – Daniel | content:serverbasics:server-backup [2025/03/29 12:22] (aktuell) – [Cron- Job] Daniel | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== Server: Backup ====== | ====== Server: Backup ====== | ||
- | There are many ways to backup your server. As NC-AIO already has Borg, you may use Borg for a complete Backup of your system. The docs can be found here: https:// | + | There are many ways to backup your server. As NC-AIO already has Borg, you may use Borg for a complete Backup of your system. The docs can be found here: [[https:// |
You need to perform everything as root. So login as root somehow (maybe use '' | You need to perform everything as root. So login as root somehow (maybe use '' | ||
Zeile 9: | Zeile 9: | ||
* /backup (should already be there by NC-AIO) | * /backup (should already be there by NC-AIO) | ||
- | * /backup/mnt | ||
* / | * / | ||
- | Please refer to the Documentations of Borg found at https:// | + | Please refer to the Documentations of Borg found at [[https:// |
For me, i chose the location ''/ | For me, i chose the location ''/ | ||
- | |||
< | < | ||
+ | |||
borg init --encryption repokey-blake2 / | borg init --encryption repokey-blake2 / | ||
</ | </ | ||
+ | |||
===== Setup a Script ===== | ===== Setup a Script ===== | ||
Zeile 35: | Zeile 35: | ||
echo " | echo " | ||
- | #This will create a btrfs readonly snapshot of root in the directory | + | #This will create a btrfs readonly snapshot of root in the directory / |
- | mkdir -p /backup/mnt/ | + | /sbin/btrfs subvolume snapshot -r / / |
- | btrfs subvolume snapshot -r / /backup/mnt/ | + | |
echo " | echo " | ||
- | / | + | / |
RETURNCODE=$? | RETURNCODE=$? | ||
- | btrfs subvolume delete | + | /sbin/btrfs subvolume delete / |
if [ ${RETURNCODE} -ne 0 ]; then | if [ ${RETURNCODE} -ne 0 ]; then | ||
- | | + | echo "Some ERROR with Borg. Stopping execution." |
- | exit ${RETURNCODE} | + | exit ${RETURNCODE} |
fi | fi | ||
Zeile 183: | Zeile 182: | ||
</ | </ | ||
+ | |||
===== Cron- Job ===== | ===== Cron- Job ===== | ||
Zeile 192: | Zeile 192: | ||
cd / | cd / | ||
./ | ./ | ||
+ | cat $0.log | ||
</ | </ |