Adding remote backup for Home Assistant.
Gitea Branch PR & Ansible Deployment / Check and Create PR (push) Successful in 20s
Gitea Branch PR & Ansible Deployment / Ansible Dry Run (rikku) (push) Successful in 3m23s
Gitea Branch PR & Ansible Deployment / Ansible Dry Run (benedikta) (push) Successful in 4m12s
Gitea Branch PR & Ansible Deployment / Ansible Dry Run (rinoa) (push) Successful in 4m19s
Gitea Branch PR & Ansible Deployment / PR Merge (push) Successful in 15s
Gitea Branch PR & Ansible Deployment / Ansible Config Deployment (rikku) (push) Successful in 3m11s
Gitea Branch PR & Ansible Deployment / Ansible Config Deployment (benedikta) (push) Successful in 3m48s
Gitea Branch PR & Ansible Deployment / Ansible Config Deployment (rinoa) (push) Successful in 3m58s

This commit is contained in:
2025-09-10 08:30:28 -04:00
parent 62c983a7f4
commit 2e468ffea9
@@ -0,0 +1,41 @@
name: home-assistant-backup-sync
description: "Daily rsync of latest Home Assistant .tar backup and prune older archives"
schedule: "30 5 * * *"
ssh:
user: pi
host: 192.168.1.252
key: /dagu/ssh/dagu_id_rsa
strictHostKey: true
steps:
- name: find-latest-backup
executor:
type: ssh
config:
# Inherit DAG-level SSH config (user=pi, host=192.168.1.252)
command: >
ls -t /home/pi/.config/docker/homeassistant/backups/*.tar |
head -n 1
output: LATEST_TAR
- name: rsync-to-destination
depends: find-latest-backup
# Execute locally (shell executor)
command: >
rsync -avz
pi@192.168.1.252:$(cat ${LATEST_TAR})
charish@192.168.1.254:/rinoa-storage/backups/home-assistant
- name: prune-old-backups
depends: rsync-to-destination
executor:
type: ssh
config:
user: charish
host: 192.168.1.254
key: /dagu/ssh/dagu_id_rsa
strictHostKey: true
command: >
cd /rinoa-storage/backups/home-assistant &&
ls -t *.tar | tail -n +8 | xargs -r rm --