aboutsummaryrefslogtreecommitdiff
path: root/modules/rsync_backup
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-05-23 03:36:43 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-05-23 03:36:43 +0200
commit46b7e62708f01eaefef78341819643eeceea8130 (patch)
tree16920a3d69d6ce492124724910f8ffd86a8d11df /modules/rsync_backup
parentf9914beb086a06e290287f299ae2c2026924a780 (diff)
downloadNix-46b7e62708f01eaefef78341819643eeceea8130.tar.gz
Nix-46b7e62708f01eaefef78341819643eeceea8130.tar.zst
Nix-46b7e62708f01eaefef78341819643eeceea8130.zip
Add check_command for backups
Diffstat (limited to 'modules/rsync_backup')
-rw-r--r--modules/rsync_backup/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/rsync_backup/default.nix b/modules/rsync_backup/default.nix
index 55b32bf..ff84fe3 100644
--- a/modules/rsync_backup/default.nix
+++ b/modules/rsync_backup/default.nix
@@ -41,6 +41,13 @@ let
41 Number of backups to keep 41 Number of backups to keep
42 ''; 42 '';
43 }; 43 };
44 check_command = lib.mkOption {
45 type = lib.types.str;
46 default = "backup";
47 description = ''
48 command to check if backup needs to be done
49 '';
50 };
44 login = lib.mkOption { 51 login = lib.mkOption {
45 type = lib.types.str; 52 type = lib.types.str;
46 description = '' 53 description = ''
@@ -128,7 +135,7 @@ let
128 -o CheckHostIP=no \ 135 -o CheckHostIP=no \
129 -p $PORT \ 136 -p $PORT \
130 -i ${ssh_key} \ 137 -i ${ssh_key} \
131 $DEST backup; then 138 $DEST ${profile.check_command}; then
132 echo "Fichier de verrouillage backup sur $DEST ou impossible de se connecter" >&2 139 echo "Fichier de verrouillage backup sur $DEST ou impossible de se connecter" >&2
133 skip=$DEST 140 skip=$DEST
134 fi 141 fi