| 1 | --- |
| 2 | # SPDX-License-Identifier: AGPL-3.0-or-later |
| 3 | # Logical backup cron + cross-region Spaces sync. The actual scripts |
| 4 | # live under deploy/postgres/ and deploy/spaces/ so they can be |
| 5 | # read/edited without booting Ansible. |
| 6 | |
| 7 | - name: Backup scripts — install |
| 8 | copy: |
| 9 | src: "{{ playbook_dir }}/../{{ item.src }}" |
| 10 | dest: "{{ item.dest }}" |
| 11 | mode: "0755" |
| 12 | loop: |
| 13 | - { src: postgres/backup-daily.sh, dest: /usr/local/bin/shithub-backup-daily } |
| 14 | - { src: spaces/sync-cross-region.sh, dest: /usr/local/bin/shithub-spaces-sync } |
| 15 | |
| 16 | - name: rclone config dir |
| 17 | file: |
| 18 | path: /root/.config/rclone |
| 19 | state: directory |
| 20 | mode: "0700" |
| 21 | |
| 22 | - name: rclone config — Spaces credentials |
| 23 | template: |
| 24 | src: rclone.conf.j2 |
| 25 | dest: /root/.config/rclone/rclone.conf |
| 26 | mode: "0600" |
| 27 | |
| 28 | - name: cron — daily logical backup |
| 29 | cron: |
| 30 | name: shithub-backup-daily |
| 31 | job: /usr/local/bin/shithub-backup-daily >> /var/log/shithub-backup.log 2>&1 |
| 32 | minute: "17" |
| 33 | hour: "3" |
| 34 | |
| 35 | - name: cron — hourly cross-region sync |
| 36 | cron: |
| 37 | name: shithub-spaces-sync |
| 38 | job: /usr/local/bin/shithub-spaces-sync >> /var/log/shithub-spaces-sync.log 2>&1 |
| 39 | minute: "23" |
| 40 |