From a772f59ac38dd52380f10fa14ea2fd39ae8342de Mon Sep 17 00:00:00 2001 From: Christopher Kolb Date: Fri, 13 Mar 2026 09:13:51 +0000 Subject: [PATCH] initial commit --- backup.sh | 12 ++++++++++++ crontab | 1 + docker-compose.yaml | 25 +++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100755 backup.sh create mode 100644 crontab create mode 100644 docker-compose.yaml diff --git a/backup.sh b/backup.sh new file mode 100755 index 0000000..dc4179f --- /dev/null +++ b/backup.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +NOW=$(date +"%Y%m%d-%H%M") +OUT="/backup/output/gitea-$NOW.tar.gz" + +echo "== Gitea SQLite Backup $NOW ==" + +tar -czvf "$OUT" /data/gitea + +echo "Backup saved as $OUT" diff --git a/crontab b/crontab new file mode 100644 index 0000000..08d9d48 --- /dev/null +++ b/crontab @@ -0,0 +1 @@ +0 1 * * * /backup/backup.sh >> /backup/cron.log 2>&1 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..cb0f069 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,25 @@ +version: "3" + +services: + server: + image: docker.gitea.com/gitea:1.25.4 + container_name: gitea + environment: + - USER_UID=1000 + - USER_GID=1000 + restart: always + volumes: + - ./data:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "3000:3000" + - "222:22" + backup: + image: alpine:latest + container_name: gitea-backup + volumes: + - ./data:/data:ro + - ./backup:/backup + - ./backup/crontab:/etc/crontabs/root:ro + entrypoint: /bin/sh -c "crond -f -l 2"