keep multiple dates of sql dumps

This commit is contained in:
admin 2024-06-24 13:08:54 +02:00
parent e7c4000fbf
commit 4de4db324e

View file

@ -21,7 +21,8 @@ in
systemd.services."nextcloud-db-backup" = {
script = with pkgs; ''
set -eu
${postgresql}/bin/pg_dump "nextcloud" | ${openssh}/bin/ssh -i /etc/nixos/.secrets/tulpan Glenn@nas "cat - > back/nextcloud/latest.sql"
date=$(date --iso-8601)
${postgresql}/bin/pg_dump "nextcloud" | ${openssh}/bin/ssh -i /etc/nixos/.secrets/tulpan Glenn@nas "cat - > back/nextcloud/sqldump/$date.sql"
'';
serviceConfig = {
Type = "oneshot";