summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Restic.hs
diff options
context:
space:
mode:
authorFélix Sipma2017-04-27 19:17:34 +0200
committerFélix Sipma2017-04-27 19:18:18 +0200
commitf6b2ab29f24c7399ed7ab718c541eb46bc0f24f7 (patch)
treeae816a894759e1eb795b721861ad8aca14b2aebc /src/Propellor/Property/Restic.hs
parentfe4b58f7db06cd59b95e73ef2a664372d0a4addd (diff)
Restic: make sure the repo exists before running restic commands
Diffstat (limited to 'src/Propellor/Property/Restic.hs')
-rw-r--r--src/Propellor/Property/Restic.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Propellor/Property/Restic.hs b/src/Propellor/Property/Restic.hs
index 55a68324..668843bb 100644
--- a/src/Propellor/Property/Restic.hs
+++ b/src/Propellor/Property/Restic.hs
@@ -86,8 +86,7 @@ init repo = check (not <$> repoExists repo) (cmdProperty "restic" initargs)
-- and then moving it to the directory.
restored :: FilePath -> ResticRepo -> Property (HasInfo + DebianLike)
restored dir repo = go
- `requires` installed
- `requires` passwordFileConfigured repo
+ `requires` init repo
where
go :: Property DebianLike
go = property (dir ++ " restored by restic") $ ifM (liftIO needsRestore)
@@ -146,8 +145,7 @@ backup dir repo crontimes extraargs kp = backup' dir repo crontimes extraargs kp
backup' :: FilePath -> ResticRepo -> Cron.Times -> [ResticParam] -> [KeepPolicy] -> Property (HasInfo + DebianLike)
backup' dir repo crontimes extraargs kp = cronjob
`describe` desc
- `requires` installed
- `requires` passwordFileConfigured repo
+ `requires` init repo
where
desc = val repo ++ " restic backup"
cronjob = Cron.niceJob ("restic_backup" ++ dir) crontimes (User "root") "/" $