deepthought.git

commit e6bfaddcd63edde4244ca6c40e297d5d0968af57

Author: Adam <git@apiote.tk>

add backup script

 backup | 14 ++++++++++++++


diff --git a/backup b/backup
new file mode 100755
index 0000000000000000000000000000000000000000..2ae9beaa57240160b955ca8c0097f00ea4493e7f
--- /dev/null
+++ b/backup
@@ -0,0 +1,14 @@
+#!/bin/sh
+if [ $(id -u) -ne 0 ]
+then
+	printf 'run as root'
+	exit 1
+fi
+
+mkdir -p /etc/backup
+
+apk list -qI | cut -d' ' -f1 | rev | cut -d'-' -f 3- | rev > /etc/backup/packages
+doas -u postgress pg_dumpall | gzip > /etc/backup/postgres.sql
+rc-status > /etc/backup/services
+
+tar czf ~/backup_$(date '+%Y%m%d') /etc/ /var/www/amuse/ /var/www/anki/ /var/www/funkwhale/start /var/www/funkwhale/stop /var/www/honk/ /var/www/huproxy/ /var/www/nextcloud/ /var/www/wallabag/ /var/www/website/ /var/www/wireguard/