From 51fc590b61a7e68a5e038919f1aaea7a1d9fcc71 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 31 Mar 2014 01:29:47 -0400 Subject: propellor spin --- Propellor/Property/Cron.hs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Propellor/Property/Cron.hs (limited to 'Propellor/Property') 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" -- cgit v1.2.3