summaryrefslogtreecommitdiff
path: root/Propellor/Property
diff options
context:
space:
mode:
authorJoey Hess2014-03-31 01:29:47 -0400
committerJoey Hess2014-03-31 01:29:47 -0400
commit51fc590b61a7e68a5e038919f1aaea7a1d9fcc71 (patch)
treea48fa9edb4ddf16a83d7b27767e5514d94c8c5f1 /Propellor/Property
parent48b4626af26ac8a8ed21692752af09a9e0d0b93e (diff)
propellor spin
Diffstat (limited to 'Propellor/Property')
-rw-r--r--Propellor/Property/Cron.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/Propellor/Property/Cron.hs b/Propellor/Property/Cron.hs
new file mode 100644
index 00000000..a3bc745d
--- /dev/null
+++ b/Propellor/Property/Cron.hs
@@ -0,0 +1,21 @@
+module Propellor.Property.Cron where
+
+import Propellor
+import qualified Propellor.Property.File as File
+import qualified Propellor.Property.Apt as Apt
+import Propellor.CmdLine
+
+type CronTimes = String
+
+-- | Installs a cron job to run propellor.
+runPropellor :: CronTimes -> Property
+runPropellor times = "/etc/cron.d/propellor" `File.hasContent`
+ [ "# Run propellor"
+ , ""
+ , "SHELL=/bin/sh"
+ , "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+ , ""
+ , times ++ "\troot\tcd " ++ localdir ++ " && nice ionice -c 3 chronic make"
+ ]
+ `requires` Apt.installed ["moreutils"]
+ `describe` "cronned propeller"