Add gitea backups

This commit is contained in:
Alex D. 2020-12-23 13:10:22 +00:00
parent c4a6992242
commit 49808f0cc5
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
2 changed files with 24 additions and 0 deletions

22
cron/gitea/APKBUILD Normal file
View File

@ -0,0 +1,22 @@
# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
pkgname=redxen-cron-gitea
pkgver=2020.12.23
pkgrel=0
pkgdesc="Gitea backup maintenance scripts"
url="https://git.redxen.eu/RedXen"
arch="noarch"
license="none"
install_if="redxen-config-gitea"
depends="dcron"
source="
cron-daily
"
options="!check"
package() {
install -dm700 "$pkgdir"/gitea/snapshots
install -Dm544 cron-daily "$pkgdir"/etc/periodic/daily/snapshot-gitea
}
sha512sums="60a658eb9db23d7183d1a48d02c6127d2a01cd10b1d9352eb92dcfb91566a18424d3a8d638fb3aeb9b3c16481dc9416f3704f9d6888ced6ac40e111f25ed1c15 cron-daily"

2
cron/gitea/cron-daily Normal file
View File

@ -0,0 +1,2 @@
/sbin/btrfs subvolume delete /gitea/snapshots/`date +"%u"`
/sbin/btrfs subvolume snapshot -r /gitea /gitea/snapshots/`date +"%u"`