ctucx.git: ansible-configs

My personal ansible roles and playbooks [deprecated in favor of nixos]

commit 06d8deb2b722110e6983812a850266ce16926271
parent 74ccc52adb791ac3825cf9153aeebb56ac6b631f
Author: Leah (ctucx) <leah@ctu.cx>
Date: Tue, 6 Apr 2021 18:58:15 +0200

roles/backup/osterei: use sh instead of bash, exclude /var/lib/websites/photos.ctu.cx
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/restic-backup/osterei.sh b/scripts/restic-backup/osterei.sh
@@ -17,7 +17,7 @@ done
 
 #backup websites
 sudo -u leah restic init --password-file /var/lib/websites/restic-password --repo rest:https://restic:$(cat /var/lib/restic-password)@restic.ctu.cx/$(hostname)-websites
-sudo -u leah restic backup --password-file /var/lib/websites/restic-password --repo rest:https://restic:$(cat /var/lib/restic-password)@restic.ctu.cx/$(hostname)-websites /var/lib/websites
+sudo -u leah restic backup --password-file /var/lib/websites/restic-password --repo rest:https://restic:$(cat /var/lib/restic-password)@restic.ctu.cx/$(hostname)-websites /var/lib/websites --exclude /var/lib/websites/photos.ctu.cx
 if [ $? -eq 0 ]; then
   echo "websites: OK" >> /root/backup.last-run
 else 

@@ -27,7 +27,7 @@ fi
 #backup postgres
 SQLFILE=/var/lib/postgresql/backup/postgres.sql
 sudo -u postgres mkdir /var/lib/postgresql/backup
-sudo -u postgres bash -c "pg_dumpall > $SQLFILE"
+sudo -u postgres sh -c "pg_dumpall > $SQLFILE"
 sudo -u postgres restic init --password-file /var/lib/postgresql/restic-password --repo rest:https://restic:$(cat /var/lib/restic-password)@restic.ctu.cx/$(hostname)-postgres
 sudo -u postgres restic backup --password-file /var/lib/postgresql/restic-password --repo rest:https://restic:$(cat /var/lib/restic-password)@restic.ctu.cx/$(hostname)-postgres /var/lib/postgresql/backup
 if [ $? -eq 0 ]; then