use weekly and monthly backups instead of daily

authelia
chatton 2 years ago
parent adf46dbf2c
commit bdcdf3c87b

@ -2,6 +2,7 @@ backups:
schedule_keys: schedule_keys:
monthly: monthly monthly: monthly
nightly: nightly nightly: nightly
weekly: weekly
homelab_user: &main_user cianhatton homelab_user: &main_user cianhatton
@ -21,7 +22,7 @@ portainer_required_files: []
restart_policy: unless-stopped restart_policy: unless-stopped
backup_labels: backup_labels:
ie.cianhatton.backup.enabled: true ie.cianhatton.backup.enabled: true
ie.cianhatton.backup.schedule: nightly ie.cianhatton.backup.schedule: weekly
docker_backup_aws_s3_encrypt: true docker_backup_aws_s3_encrypt: true
docker_backup_host_backup_directory: "/tmp" docker_backup_host_backup_directory: "/tmp"

@ -5,7 +5,7 @@
vars: vars:
# corrsponds to which category of backups will be used. # corrsponds to which category of backups will be used.
# determined based on the docker labels. # determined based on the docker labels.
schedule: nightly schedule: weekly
pre_tasks: pre_tasks:
- name: Include vault variables. - name: Include vault variables.

@ -8,6 +8,11 @@
- name: "{{ plex_portainer_stack_name }}_config" - name: "{{ plex_portainer_stack_name }}_config"
- name: "{{ plex_portainer_stack_name }}_tautulli_config" - name: "{{ plex_portainer_stack_name }}_tautulli_config"
- name: Plex | Set fact plex_labels.
set_fact:
plex_labels:
ie.cianhatton.backup.schedule: monthly
- name: "Plex | Update Portainer." - name: "Plex | Update Portainer."
chatton.portainer.portainer_stack: chatton.portainer.portainer_stack:
username: '{{ portainer_user }}' username: '{{ portainer_user }}'
@ -20,7 +25,7 @@
version: "3" version: "3"
services: services:
plex: plex:
labels: "{{ backup_labels }}" labels: "{{ backup_labels | combine(plex_labels) }}"
image: "{{ plex_image }}:{{ plex_tag }}" image: "{{ plex_image }}:{{ plex_tag }}"
container_name: "{{ plex_container_name }}" container_name: "{{ plex_container_name }}"
ports: ports:

@ -62,4 +62,33 @@
{{ ansible_pull_path }} {{ ansible_pull_path }}
-U https://github.com/chatton/ansible-homelab playbooks/backup-docker-volumes.yml -e schedule=nightly >> ~/logs/nightly.log 2>&1 -U https://github.com/chatton/ansible-homelab playbooks/backup-docker-volumes.yml -e schedule=nightly >> ~/logs/nightly.log 2>&1
cron_file: ansible_nightly_docker_volume_backup cron_file: ansible_nightly_docker_volume_backup
state: absent
- name: Ensure Weekly Cron Backups
tags: ["cron"]
ansible.builtin.cron:
name: backup docker volumes (weekly)
weekday: "0"
minute: "0"
hour: "{{ cron_hour }}"
user: "{{ homelab_user }}"
job: >
{{ ansible_pull_path }}
-U https://github.com/chatton/ansible-homelab playbooks/backup-docker-volumes.yml -e schedule=weekly >> ~/logs/weekly.log 2>&1
cron_file: ansible_weekly_docker_volume_backup
state: present
- name: Ensure Monthly Cron Backups
tags: ["cron"]
ansible.builtin.cron:
name: backup docker volumes (monthly)
day: "1"
minute: "0"
hour: "{{ cron_hour }}"
user: "{{ homelab_user }}"
job: >
{{ ansible_pull_path }}
-U https://github.com/chatton/ansible-homelab playbooks/backup-docker-volumes.yml -e schedule=monthly >> ~/logs/monthly.log 2>&1
cron_file: ansible_monthly_docker_volume_backup
state: present state: present

@ -4,7 +4,7 @@ services:
ghost: ghost:
labels: labels:
ie.cianhatton.backup.enabled: "true" ie.cianhatton.backup.enabled: "true"
ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.nightly }}" ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.weekly }}"
image: ghost:4-alpine image: ghost:4-alpine
restart: unless-stopped restart: unless-stopped
container_name: ghost container_name: ghost

@ -4,7 +4,7 @@ services:
hastey-paste: hastey-paste:
labels: labels:
ie.cianhatton.backup.enabled: "true" ie.cianhatton.backup.enabled: "true"
ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.nightly }}" ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.weekly }}"
container_name: hastey-paste container_name: hastey-paste
image: ghcr.io/enchant97/hasty-paste:1 image: ghcr.io/enchant97/hasty-paste:1
restart: unless-stopped restart: unless-stopped

@ -4,7 +4,7 @@ services:
mariadb: mariadb:
labels: labels:
ie.cianhatton.backup.enabled: "true" ie.cianhatton.backup.enabled: "true"
ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.nightly }}" ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.weekly }}"
container_name: mariadb container_name: mariadb
image: "{{ template_vars.image }}:{{ template_vars.tag }}" image: "{{ template_vars.image }}:{{ template_vars.tag }}"
hostname: mariadb hostname: mariadb

@ -4,7 +4,7 @@ services:
nextcloud: nextcloud:
labels: labels:
ie.cianhatton.backup.enabled: "true" ie.cianhatton.backup.enabled: "true"
ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.nightly }}" ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.weekly }}"
image: "{{ template_vars.image }}:{{ template_vars.tag }}" image: "{{ template_vars.image }}:{{ template_vars.tag }}"
container_name: nextcloud container_name: nextcloud
restart: unless-stopped restart: unless-stopped

@ -4,7 +4,7 @@ services:
paperless-ng: paperless-ng:
labels: labels:
ie.cianhatton.backup.enabled: "true" ie.cianhatton.backup.enabled: "true"
ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.nightly }}" ie.cianhatton.backup.schedule: "{{ backups.schedule_keys.weekly }}"
image: lscr.io/linuxserver/paperless-ng:latest image: lscr.io/linuxserver/paperless-ng:latest
container_name: paperless-ng container_name: paperless-ng
environment: environment:

Loading…
Cancel
Save