backup module script improvement

This commit is contained in:
boyreau 2026-08-17 17:07:55 +02:00
commit 92d0f25480

View file

@ -71,23 +71,12 @@ in
DST=$(mktemp --suffix=.tar) DST=$(mktemp --suffix=.tar)
echo "Archiving and compressing $SRC to $DST." echo "Archiving and compressing $SRC to $DST."
${cfg.compression.command} ${cfg.compression.command}
''
+ (
if cfg.encryption.command != null then
/* bash */ ''
# Archive encryption (optionnal) # Archive encryption (optionnal)
SRC=$DST SRC=$DST
DST=$(mktemp --suffix=.tar.encrypted) DST=$(mktemp --suffix=.tar.encrypted)
echo "Encyphering $SRC to $DST." echo "Encyphering $SRC to $DST."
'' ${cfg.encryption.command}
+ cfg.encryption.command
+ "
"
else
""
)
+ /* bash */ ''
# Archive salvation # Archive salvation
SRC=$DST SRC=$DST