From 5770ab4a593d84cf8614a2892701ce5fe7be06d3 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 1 Oct 2023 17:06:09 +0100 Subject: [PATCH] Sync dokku data to tank This is much easier than mounting the files themselves --- ansible/roles/dokku/tasks/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ansible/roles/dokku/tasks/main.yml b/ansible/roles/dokku/tasks/main.yml index 47d783c..6326968 100644 --- a/ansible/roles/dokku/tasks/main.yml +++ b/ansible/roles/dokku/tasks/main.yml @@ -51,3 +51,13 @@ mode: "644" notify: restart nginx become: true + +# https://dokku.com/docs/advanced-usage/backup-recovery/ +- name: Sync data to app-data + cron: + name: clean up docker containers + hour: "*/6" + minute: 0 + user: root + job: rsync --archive --progress -h /var/lib/dokku/{config,data,services} /home/dokku --exclude '/home/dokku/**/cache/*' /mnt/tank/app-data/dokku/ + cron_file: dokku-data-sync