Optimized backup scripts

This commit is contained in:
Kevin Veen-Birkenbach 2023-04-12 10:36:38 +02:00
parent 822f1524e8
commit 883c949466
3 changed files with 12 additions and 5 deletions

View File

@ -2,7 +2,8 @@
Description=starts backups-cleanup.service
[Timer]
OnCalendar=19:00
OnBootSec=1min
OnUnitActiveSec=12h
RandomizedDelaySec=1h
[Install]

View File

@ -1,15 +1,21 @@
- name: "create {{docker_pull_primary_backups_folder}}"
file:
path: "{{docker_pull_primary_backups_folder}}"
state: directory
mode: 0755
- name: create pull-remote-backup.sh
copy:
src: pull-remote-backup.sh
dest: "bash {{docker_pull_primary_backups_folder}}pull-remote-backup.sh"
dest: "{{docker_pull_primary_backups_folder}}pull-remote-backup.sh"
- name: create pull-remote-backups.service
template: src=pull-remote-backups.service.j2 dest=/etc/systemd/system/pull-remote-backups.service
notify: restart pull-remote-backups serviceß
notify: restart pull-remote-backups service
- name: create pull-remote-backups.timer
template: src=pull-remote-backups.timer.j2 dest=/etc/systemd/system/pull-remote-backups.timer
notify: restart pull-remote-backups timer
- name: create pull-remote-backups.sh
template: src=pull-remote-backups.sh.j2 dest=bash {{docker_pull_primary_backups_folder}}pull-remote-backups.sh
template: src=pull-remote-backups.sh.j2 dest={{docker_pull_primary_backups_folder}}pull-remote-backups.sh

View File

@ -1 +1 @@
docker_pull_primary_backups_folder: "/usr/local/bin/pull-primary-backups/"
docker_pull_primary_backups_folder: "/home/administrator/scripts/pull-primary-backups/"