mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 05:36:59 +01:00
Backup fix: touch backup-ok in post hook
This commit is contained in:
parent
5e140baa51
commit
d46bcbbad1
1 changed files with 8 additions and 6 deletions
|
|
@ -29,11 +29,7 @@ in {
|
||||||
|
|
||||||
postHook = mkOption {
|
postHook = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = ''
|
default = "";
|
||||||
if [ $exitStatus -eq 0 ]; then
|
|
||||||
touch /nix/var/data/backup/backup-ok
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
startAt = mkOption {
|
startAt = mkOption {
|
||||||
|
|
@ -65,7 +61,13 @@ in {
|
||||||
};
|
};
|
||||||
readWritePaths = cfg.readWritePaths;
|
readWritePaths = cfg.readWritePaths;
|
||||||
preHook = cfg.preHook;
|
preHook = cfg.preHook;
|
||||||
postHook = cfg.postHook;
|
postHook = ''
|
||||||
|
${cfg.postHook}
|
||||||
|
if [ $exitStatus -eq 0 ]; then
|
||||||
|
touch /nix/var/data/backup/backup-ok
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
environment = { BORG_RSH = "ssh -i ${cfg.sshKey}"; };
|
environment = { BORG_RSH = "ssh -i ${cfg.sshKey}"; };
|
||||||
compression = "lz4";
|
compression = "lz4";
|
||||||
startAt = cfg.startAt;
|
startAt = cfg.startAt;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue