summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Restic.hs
diff options
context:
space:
mode:
authorJoey Hess2017-04-27 19:07:26 -0400
committerJoey Hess2017-04-27 19:07:26 -0400
commit40e757c8f01e2e706dc54a5905f6be27159808c0 (patch)
tree24c04bbf836d0ca15fa84de19aa4cb427443720c /src/Propellor/Property/Restic.hs
parentfabce00bc20a176fb593f6107de5c54f45cf1896 (diff)
parentb06edbda0478ed57954d716f64f6870d7ae68f63 (diff)
Merge commit 'b06edbda0478ed57954d716f64f6870d7ae68f63'
Diffstat (limited to 'src/Propellor/Property/Restic.hs')
-rw-r--r--src/Propellor/Property/Restic.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Propellor/Property/Restic.hs b/src/Propellor/Property/Restic.hs
index ef867de3..64cd4091 100644
--- a/src/Propellor/Property/Restic.hs
+++ b/src/Propellor/Property/Restic.hs
@@ -149,17 +149,17 @@ backup' dir repo crontimes extraargs kp = cronjob
where
desc = val repo ++ " restic backup"
cronjob = Cron.niceJob ("restic_backup" ++ dir) crontimes (User "root") "/" $
- "flock " ++ shellEscape lockfile ++ " sh -c " ++ backupcmd
+ "flock " ++ shellEscape lockfile ++ " sh -c " ++ shellEscape backupcmd
lockfile = "/var/lock/propellor-restic.lock"
- backupcmd = intercalate ";" $
+ backupcmd = intercalate " && " $
createCommand
: if null kp then [] else [pruneCommand]
createCommand = unwords $
[ "restic"
, "-r"
- , val repo
+ , shellEscape (val repo)
, "--password-file"
- , getPasswordFile repo
+ , shellEscape (getPasswordFile repo)
]
++ map shellEscape extraargs ++
[ "backup"
@@ -168,9 +168,9 @@ backup' dir repo crontimes extraargs kp = cronjob
pruneCommand = unwords $
[ "restic"
, "-r"
- , val repo
+ , shellEscape (val repo)
, "--password-file"
- , getPasswordFile repo
+ , shellEscape (getPasswordFile repo)
, "forget"
, "--prune"
]