restic: --one-file-system + excludes (#335)

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#335
Co-authored-by: mg <michael.grote@posteo.de>
Co-committed-by: mg <michael.grote@posteo.de>
This commit is contained in:
Michael Grote 2022-02-24 17:11:02 +01:00
parent 428a87144c
commit 9fb0401eca
12 changed files with 11 additions and 32 deletions

View file

@ -17,10 +17,12 @@
**/**cache***/** **/**cache***/**
**/**Cache***/** **/**Cache***/**
**/**AppData***/** **/**AppData***/**
# https://github.com/restic/restic/issues/1005
# https://forum.restic.net/t/exclude-syntax-confusion/1531/12
restic_mount_timeout: "10 min" restic_mount_timeout: "10 min"
restic_failure_delay: "30 s" restic_failure_delay: "30 s"
restic_schedule: "0/6:00" restic_schedule: "0/6:00"
restic_folders_to_backup: "/usr/local /etc /root /var/www /home" restic_folders_to_backup: "/" # --one-file-system ist gesetzt, also werden weitere Dateisysteme nicht eigeschlossen, es sei denn sie werden hier explizit angegeben; https://restic.readthedocs.io/en/latest/040_backup.html#excluding-files
restic_repository: "//fileserver2.grote.lan/restic" restic_repository: "//fileserver2.grote.lan/restic"
restic_repository_password: "{{ lookup('keepass', 'restic_repository_password', 'password') }}" restic_repository_password: "{{ lookup('keepass', 'restic_repository_password', 'password') }}"
restic_mount_user: restic restic_mount_user: restic

View file

@ -10,8 +10,6 @@
### geerlingguy.ansible ### geerlingguy.ansible
ansible_install_method: pip ansible_install_method: pip
ansible_install_version_pip: '2.10' ansible_install_version_pip: '2.10'
### mgrote.restic
restic_folders_to_backup: "/usr/local /etc /root /home"
### mgrote.apt_manage_packages ### mgrote.apt_manage_packages
apt_packages_extra: apt_packages_extra:
- sshpass - sshpass

View file

@ -24,18 +24,5 @@
pip_package: python3-pip pip_package: python3-pip
pip_install_packages: pip_install_packages:
- name: docker # für munin-plugin docker_ - name: docker # für munin-plugin docker_
### mgrote.restic
restic_cron_hours: "*/6"
restic_exclude: |
._*
desktop.ini
.Trash-*
**/**cache***/**
**/**Cache***/**
**/**AppData***/**
/var/lib/docker/volumes/***Musik***
/var/lib/docker/volumes/***musik***
# https://github.com/restic/restic/issues/1005
# https://forum.restic.net/t/exclude-syntax-confusion/1531/12
### mgrote.docker-compose-deploy ### mgrote.docker-compose-deploy
docker_compose_base_dir: /home/mg/docker docker_compose_base_dir: /home/mg/docker

View file

@ -1,6 +1,4 @@
--- ---
### mgrote.restic
restic_folders_to_backup: /usr/local /etc /root /var/www /home
### oefenweb.ufw ### oefenweb.ufw
ufw_rules: ufw_rules:
- rule: allow - rule: allow

View file

@ -1,6 +1,4 @@
--- ---
### mgrote.restic
restic_folders_to_backup: "/usr/local /etc /root /var/lib /home"
### oefenweb.ufw ### oefenweb.ufw
ufw_rules: ufw_rules:
- rule: allow - rule: allow

View file

@ -29,7 +29,6 @@
- path: /home/mg/.config/alacritty - path: /home/mg/.config/alacritty
- path: /home/mg/.config/.ssh - path: /home/mg/.config/.ssh
- path: /home/mg/.config/flameshot - path: /home/mg/.config/flameshot
dotfiles_owner: mg dotfiles_owner: mg
### mgrote.apt_manage_packages ### mgrote.apt_manage_packages
apt_packages_extra: apt_packages_extra:

View file

@ -1,4 +1,10 @@
--- ---
### mgrote.restic
restic_folders_to_backup: "/ /etc/pve"
### mgrote.restic
#restic_exclude: |
# /hdd_data_raidz/**
# /rpool/**
### mgrote.user ### mgrote.user
users: users:
- username: root - username: root

View file

@ -38,6 +38,3 @@
protocol: tcp protocol: tcp
comment: 'munin' comment: 'munin'
from_ip: 0.0.0.0/0 from_ip: 0.0.0.0/0
### mgrote.restic
restic_folders_to_backup: /usr/local /etc /root /home

View file

@ -220,5 +220,3 @@
env.max_time 20 env.max_time 20
env.short_label true env.short_label true
env.follow_redirect true env.follow_redirect true
### mgrote.restic
restic_folders_to_backup: /usr/local /etc /root /home /var/lib/docker

View file

@ -75,5 +75,3 @@
env.max_time 20 env.max_time 20
env.short_label true env.short_label true
env.follow_redirect true env.follow_redirect true
### mgrote.restic
restic_folders_to_backup: /usr/local /etc /root /home /var/lib/docker

View file

@ -19,9 +19,6 @@
repository_user: mg repository_user: mg
repository_user_password: "{{ lookup('keepass', 'gitea_mg_https_password', 'password') }}" repository_user_password: "{{ lookup('keepass', 'gitea_mg_https_password', 'password') }}"
### mgrote.restic
restic_folders_to_backup: /usr/local /etc /root /home
### geerlingguy.munin-node ### geerlingguy.munin-node
munin_node_plugins: munin_node_plugins:
- name: timesync - name: timesync

View file

@ -8,7 +8,8 @@ OnFailure=restic_mail.service
[Service] [Service]
Type=simple Type=simple
EnvironmentFile={{ restic_conf_dir }}/restic.env EnvironmentFile={{ restic_conf_dir }}/restic.env
ExecStart=/usr/bin/restic backup --no-cache --exclude-file {{ restic_conf_dir }}/excludes {{ restic_folders_to_backup }} ExecStart=/usr/bin/restic backup --one-file-system --no-cache --iexclude-file {{ restic_conf_dir }}/excludes {{ restic_folders_to_backup }}
{# -iexclude-file Same as exclude-file but ignores cases like in --iexclude; https://restic.readthedocs.io/en/latest/040_backup.html #}
User={{ restic_user }} User={{ restic_user }}
Group={{ restic_group }} Group={{ restic_group }}
RestartSec={{ restic_failure_delay }} RestartSec={{ restic_failure_delay }}