This commit is contained in:
Kekskurse 2023-08-07 01:03:59 +02:00
parent a30b023cda
commit 63a900dd13
Signed by: kekskurse
GPG key ID: 728ACCB59341E7E4
2 changed files with 22 additions and 1 deletions

View file

@ -155,4 +155,17 @@
src: app.ini
dest: /etc/forgejo/app.ini
notify:
- Restart forgejo
- Restart forgejo
#Backup
- name: backup script
ansible.builtin.template:
src: backup.sh
dest: /usr/local/bin/backup.sh
mode: '0770'
- name: Backup
ansible.builtin.cron:
name: "backup"
minute: "0"
hour: "3"
job: "/usr/local/bin/backup.sh > /dev/null"

View file

@ -0,0 +1,8 @@
#!/bin/sh
set +e
d=$(date +%Y-%m-%d)
cd /tmp
sudo -u git /usr/local/bin/forgejo dump --config /etc/forgejo/app.ini --file /tmp/gitea-dump.zip
/usr/local/bin/b2 upload-file --noProgress --quiet kekskurse-backups /tmp/gitea-dump.zip git.keks.cloud/forgejo/$d.zip
rm /tmp/gitea-dump
curl "{{ monitorurl }}"