chore: simplify sudo command for backups

This commit is contained in:
Benjamin Bädorf 2023-11-06 22:22:36 +01:00
parent 052d752d27
commit c8233cf6a7
No known key found for this signature in database
GPG key ID: 4406E80E13CD656C
4 changed files with 4 additions and 4 deletions

View file

@ -122,7 +122,7 @@
passwordFile = config.age.secrets."restic-repo-droppie".path;
repository = "yule@droppie.b12f.io:/media/internal/backups-pub-solar";
backupPrepareCommand = ''
${pkgs.sudo}/bin/sudo -iu postgres ${pkgs.postgresql}/bin/pg_dump -d gitea > /tmp/forgejo-backup.sql
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d gitea > /tmp/forgejo-backup.sql
'';
backupCleanupCommand = ''
rm /tmp/forgejo-backup.sql

View file

@ -60,7 +60,7 @@
passwordFile = config.age.secrets."restic-repo-droppie".path;
repository = "yule@droppie.b12f.io:/media/internal/backups-pub-solar";
backupPrepareCommand = ''
${pkgs.sudo}/bin/sudo -iu postgres ${pkgs.postgresql}/bin/pg_dump -d keycloak > /tmp/keycloak-backup.sql
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d keycloak > /tmp/keycloak-backup.sql
'';
backupCleanupCommand = ''
rm /tmp/keycloak-backup.sql

View file

@ -107,7 +107,7 @@
passwordFile = config.age.secrets."restic-repo-droppie".path;
repository = "yule@droppie.b12f.io:/media/internal/backups-pub-solar";
backupPrepareCommand = ''
${pkgs.sudo}/bin/sudo -iu postgres ${pkgs.postgresql}/bin/pg_dump -d mastodon > /tmp/mastodon-backup.sql
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d mastodon > /tmp/mastodon-backup.sql
'';
backupCleanupCommand = ''
rm /tmp/mastodon-backup.sql

View file

@ -145,7 +145,7 @@
passwordFile = config.age.secrets."restic-repo-droppie".path;
repository = "yule@droppie.b12f.io:/media/internal/backups-pub-solar";
backupPrepareCommand = ''
${pkgs.sudo}/bin/sudo -iu postgres ${pkgs.postgresql}/bin/pg_dump -d nextcloud > /tmp/nextcloud-backup.sql
${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/pg_dump -d nextcloud > /tmp/nextcloud-backup.sql
'';
backupCleanupCommand = ''
rm /tmp/nextcloud-backup.sql