2014-03-31 05:29:47 +00:00
|
|
|
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"
|
|
|
|
]
|
2014-03-31 05:31:47 +00:00
|
|
|
`requires` Apt.installed ["util-linux", "cron", "moreutils"]
|
2014-03-31 05:29:47 +00:00
|
|
|
`describe` "cronned propeller"
|