admin:infrastructure:backup
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteDernière révisionLes deux révisions suivantes | ||
admin:infrastructure:backup [2021/01/02 17:46] – fpoulain | admin:infrastructure:backup [2021/01/02 17:50] – [Log rotate] fpoulain | ||
---|---|---|---|
Ligne 146: | Ligne 146: | ||
su - postgres -c " | su - postgres -c " | ||
done | done | ||
+ | </ | ||
+ | |||
+ | <code bash scripts/ | ||
+ | #!/bin/bash | ||
+ | |||
+ | if test -x / | ||
+ | backup_dir=/ | ||
+ | db=icinga2 | ||
+ | |||
+ | # Prepare. | ||
+ | mkdir -p $backup_dir | ||
+ | chmod 700 $backup_dir | ||
+ | |||
+ | # Backup. | ||
+ | influxd backup -portable -database $db -host localhost: | ||
+ | |||
+ | # Prune. | ||
+ | find $backup_dir/ | ||
+ | fi | ||
</ | </ | ||
Ligne 243: | Ligne 262: | ||
exit 0 | exit 0 | ||
+ | </ | ||
+ | |||
+ | ==== Rsyslog ==== | ||
+ | |||
+ | <code conf / | ||
+ | if $programname == ' | ||
+ | & stop | ||
</ | </ | ||
==== Log rotate ==== | ==== Log rotate ==== | ||
- | <code conf debian/logrotate> | + | <code conf debian/borgmatic> |
- | /var/log/backup.log { | + | /var/log/borgmatic.log |
- | weekly | + | { |
- | | + | |
- | | + | |
- | | + | compress |
- | | + | missingok |
- | notifempty | + | notifempty |
- | create 644 root root | + | |
} | } | ||
</ | </ |
admin/infrastructure/backup.txt · Dernière modification : 2021/01/02 17:53 de fpoulain