From a12b50a01fb1f20fcf6834e4d8499903585934b9 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@clevo" Date: Wed, 28 Sep 2022 22:03:57 +0200 Subject: [PATCH] Setup gitea-backup crontab --- roles/gitea/files/gitea-backup.cron | 1 + roles/gitea/tasks/main.yml | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 roles/gitea/files/gitea-backup.cron diff --git a/roles/gitea/files/gitea-backup.cron b/roles/gitea/files/gitea-backup.cron new file mode 100644 index 0000000..42eb9cc --- /dev/null +++ b/roles/gitea/files/gitea-backup.cron @@ -0,0 +1 @@ +0 5 * * * USER=git /home/git/gitea_backup.sh backup >/home/git/gitea_backup.log 2>/home/git/gitea_backup.err && USER=git /home/git/gitea_backup.sh prune 2 >>/home/git/gitea_backup.log 2>>/home/git/gitea_backup.err diff --git a/roles/gitea/tasks/main.yml b/roles/gitea/tasks/main.yml index f9ea8e0..43a8411 100644 --- a/roles/gitea/tasks/main.yml +++ b/roles/gitea/tasks/main.yml @@ -201,4 +201,9 @@ cmd: "/home/git/gitea_backup.sh restore /home/git/gitea-dumps/gitea-dump-{{ today }}.zip" creates: /home/git/gitea-repositories # when this dir exists, the command won't run, so we don't overwrite existing repos -# TODO: setup gitea_backup cron +- name: Setup gitea-backup crontab + become: true + copy: + src: gitea-backup.cron + dest: /etc/cron.d/gitea-backup + mode: 0644