Add task for backup

This commit is contained in:
Przemysław Grondek 2023-09-22 20:05:32 +02:00
parent 5087cbca6d
commit 6564f78511
5 changed files with 48 additions and 0 deletions

View File

@ -14,6 +14,7 @@
- docker - docker
- laptop - laptop
- desktop - desktop
- backup
# - flutter # - flutter
# - virtual # - virtual

View File

@ -0,0 +1,13 @@
timestamp_format long
snapshot_preserve_min 24h
snapshot_preserve 7d 4w 3m
volume /home
snapshot_dir /home/.snapshots
subvolume /home
volume /
snapshot_dir /.snapshot_dir
subvolume /

View File

@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/btrbk -q run

View File

@ -0,0 +1,29 @@
---
- name: install btrbk
become: yes
community.general.pacman:
name:
- btrfs-progs
- btrbk
- cronie
- name: "Enable cron"
become: yes
ansible.builtin.systemd:
name: cronie
state: started
enabled: yes
- name: Copy configuration
become: yes
copy:
src: etc/btrbk/btrbk.conf
dest: /etc/btrbk/btrbk.conf
mode: 0644
- name: Add cron daily
become: yes
copy:
src: etc/cron.daily/btrbk
dest: /etc/cron.daily/btrbk
mode: 0755

View File

@ -0,0 +1,3 @@
---
- import_tasks: arch.yml
when: ansible_distribution == "Archlinux"