mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
Merge pull request #49840 from markuskowa/fix-pgBackup
nixos/postgresqlBackup: set to umask to 0077
This commit is contained in:
commit
58c0c2574c
@ -20,6 +20,8 @@ let
|
||||
'';
|
||||
|
||||
script = ''
|
||||
umask 0077 # ensure backup is only readable by postgres user
|
||||
|
||||
if [ -e ${cfg.location}/${db}.sql.gz ]; then
|
||||
${pkgs.coreutils}/bin/mv ${cfg.location}/${db}.sql.gz ${cfg.location}/${db}.prev.sql.gz
|
||||
fi
|
||||
|
@ -58,6 +58,7 @@ let
|
||||
# Check backup service
|
||||
$machine->succeed("systemctl start postgresqlBackup-postgres.service");
|
||||
$machine->succeed("zcat /var/backup/postgresql/postgres.sql.gz | grep '<test>ok</test>'");
|
||||
$machine->succeed("stat -c '%a' /var/backup/postgresql/postgres.sql.gz | grep 600");
|
||||
$machine->shutdown;
|
||||
'';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user