3
0
Fork 0
forked from mirrors/nixpkgs

tarsnap service: add 'verbose' config option (#25353)

This commit is contained in:
Renzo Carbonara 2017-05-01 17:09:45 +02:00 committed by Joachim F
parent b69d04c798
commit 9a5916dc47

View file

@ -230,6 +230,14 @@ in
Download bandwidth rate limit in bytes.
'';
};
verbose = mkOption {
type = types.bool;
default = false;
description = ''
Whether to produce verbose logging output.
'';
};
};
}
));
@ -293,7 +301,10 @@ in
'';
script =
let run = ''tarsnap --configfile "/etc/tarsnap/${name}.conf" -c -f "${name}-$(date +"%Y%m%d%H%M%S")" ${concatStringsSep " " cfg.directories}'';
let run = ''tarsnap --configfile "/etc/tarsnap/${name}.conf" \
-c -f "${name}-$(date +"%Y%m%d%H%M%S")" \
${optionalString cfg.verbose "-v"} \
${concatStringsSep " " cfg.directories}'';
in if (cfg.cachedir != null) then ''
mkdir -p ${cfg.cachedir}
chmod 0700 ${cfg.cachedir}