Add role gitea-backup

This commit is contained in:
flyingscorpio@clevo 2022-03-10 21:47:56 +01:00
parent cf022de69a
commit efb88c0937
7 changed files with 36 additions and 16 deletions

View file

@ -11,14 +11,6 @@ etckeeper:
- run: - run:
- sudo etckeeper commit "First commit" - sudo etckeeper commit "First commit"
gitea_backup_rsync:
- run:
- sudo ln -rsi dotfiles/systemd/gitea_backup_rsync.timer /etc/systemd/system/gitea_backup_rsync.timer
- run:
- sudo ln -rsi dotfiles/systemd/gitea_backup_rsync.service /etc/systemd/system/gitea_backup_rsync.service
- run:
- sudo systemctl enable gitea_backup_rsync.timer
gaming: gaming:
- run: - run:
command: sudo cp /etc/pacman.conf /etc/pacman.conf.backup command: sudo cp /etc/pacman.conf /etc/pacman.conf.backup

View file

@ -1,8 +0,0 @@
[Unit]
Description=Fetch gitea dumps from Lime2 with rsync
Wants=network-online.target
After=network-online.target nss-lookup.target
[Service]
Type=simple
ExecStart=sudo -u flyingscorpio /usr/bin/rsync -zvva --delete tunuifranken.info:/home/git/gitea-dumps /run/media/flyingscorpio/spare/backups/rsync-backups/lime2

View file

@ -29,3 +29,4 @@
- { role: libvirt, tags: libvirt } - { role: libvirt, tags: libvirt }
- { role: mariadb, tags: mariadb } - { role: mariadb, tags: mariadb }
- { role: rsync-backup, tags: rsync-backup } - { role: rsync-backup, tags: rsync-backup }
- { role: gitea-backup, tags: gitea-backup }

View file

@ -7,3 +7,5 @@ Persistent=true
[Install] [Install]
WantedBy=timers.target WantedBy=timers.target
# vim: ft=systemd

View file

@ -0,0 +1,11 @@
---
- name: Run daemon-reload
systemd:
daemon-reload: true
scope: user
- name: Enable gitea-backup timer
systemd:
name: gitea-backup.timer
enabled: true
scope: user

View file

@ -0,0 +1,14 @@
---
- name: Copy gitea-backup timer
copy:
src: gitea-backup.timer
dest: ~/.config/systemd/user/gitea-backup.timer
notify:
- Run daemon-reload
- Enable gitea-backup timer
- name: Copy gitea-backup service
template:
src: gitea-backup.service.j2
dest: ~/.config/systemd/user/gitea-backup.service
notify: Run daemon-reload

View file

@ -0,0 +1,8 @@
[Unit]
Description=Fetch gitea dumps from Lime2 with rsync
Wants=network-online.target
After=network-online.target nss-lookup.target
[Service]
Type=simple
ExecStart=/usr/bin/rsync -zvva --delete tunuifranken.info:/home/git/gitea-dumps /run/media/{{ ansible_facts['env']['USER'] }}/spare/backups/rsync-backups/lime2