propellor spin
This commit is contained in:
parent
ebb7353f49
commit
79f1a6c67b
|
@ -97,7 +97,7 @@ hosts = -- (o) `
|
||||||
, "--exclude=/home/joey/lib"
|
, "--exclude=/home/joey/lib"
|
||||||
, "--exclude=.*/tmp/"
|
, "--exclude=.*/tmp/"
|
||||||
] Obnam.OnlyClient
|
] Obnam.OnlyClient
|
||||||
`requires` Gpg.keyImported "" "root"
|
`requires` Gpg.keyImported "98147487" "root"
|
||||||
`requires` Ssh.keyImported SshRsa "root"
|
`requires` Ssh.keyImported SshRsa "root"
|
||||||
(Context "kite.kitenet.net")
|
(Context "kite.kitenet.net")
|
||||||
|
|
||||||
|
@ -175,12 +175,13 @@ hosts = -- (o) `
|
||||||
|
|
||||||
& alias "eubackup.kitenet.net"
|
& alias "eubackup.kitenet.net"
|
||||||
& Apt.installed ["obnam", "sshfs", "rsync"]
|
& Apt.installed ["obnam", "sshfs", "rsync"]
|
||||||
& JoeySites.githubBackup
|
|
||||||
& JoeySites.obnamRepos ["wren", "pell", "kite"]
|
& JoeySites.obnamRepos ["wren", "pell", "kite"]
|
||||||
& Ssh.knownHost hosts "usw-s002.rsync.net" "joey"
|
& JoeySites.githubBackup
|
||||||
|
& JoeySites.rsyncNetBackup hosts
|
||||||
|
& JoeySites.backupsBackedupTo hosts "usbackup.kitenet.net" "lib/backup/eubackup"
|
||||||
|
|
||||||
& alias "podcatcher.kitenet.net"
|
& alias "podcatcher.kitenet.net"
|
||||||
& Apt.installed ["git-annex"]
|
& JoeySites.podcatcher
|
||||||
|
|
||||||
& alias "znc.kitenet.net"
|
& alias "znc.kitenet.net"
|
||||||
& JoeySites.ircBouncer
|
& JoeySites.ircBouncer
|
||||||
|
@ -364,6 +365,7 @@ monsters = -- but do want to track their public keys etc.
|
||||||
& ipv4 "67.223.19.96"
|
& ipv4 "67.223.19.96"
|
||||||
& ipv6 "2001:4978:f:2d9::2"
|
& ipv6 "2001:4978:f:2d9::2"
|
||||||
& alias "backup.kitenet.net"
|
& alias "backup.kitenet.net"
|
||||||
|
& alias "usbackup.kitenet.net"
|
||||||
& sshPubKey "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAokMXQiX/NZjA1UbhMdgAscnS5dsmy+Q7bWrQ6tsTZ/o+6N/T5cbjoBHOdpypXJI3y/PiJTDJaQtXIhLa8gFg/EvxMnMz/KG9skADW1361JmfCc4BxicQIO2IOOe6eilPr+YsnOwiHwL0vpUnuty39cppuMWVD25GzxXlS6KQsLCvXLzxLLuNnGC43UAM0q4UwQxDtAZEK1dH2o3HMWhgMP2qEQupc24dbhpO3ecxh2C9678a3oGDuDuNf7mLp3s7ptj5qF3onitpJ82U5o7VajaHoygMaSRFeWxP2c13eM57j3bLdLwxVXFhePcKXARu1iuFTLS5uUf3hN6MkQcOGw=="
|
& sshPubKey "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAokMXQiX/NZjA1UbhMdgAscnS5dsmy+Q7bWrQ6tsTZ/o+6N/T5cbjoBHOdpypXJI3y/PiJTDJaQtXIhLa8gFg/EvxMnMz/KG9skADW1361JmfCc4BxicQIO2IOOe6eilPr+YsnOwiHwL0vpUnuty39cppuMWVD25GzxXlS6KQsLCvXLzxLLuNnGC43UAM0q4UwQxDtAZEK1dH2o3HMWhgMP2qEQupc24dbhpO3ecxh2C9678a3oGDuDuNf7mLp3s7ptj5qF3onitpJ82U5o7VajaHoygMaSRFeWxP2c13eM57j3bLdLwxVXFhePcKXARu1iuFTLS5uUf3hN6MkQcOGw=="
|
||||||
, host "wren.kitenet.net"
|
, host "wren.kitenet.net"
|
||||||
& ipv4 "80.68.85.49"
|
& ipv4 "80.68.85.49"
|
||||||
|
|
|
@ -42,7 +42,7 @@ job desc times user cddir command = cronjobfile `File.hasContent`
|
||||||
-- | Installs a cron job, and runs it niced and ioniced.
|
-- | Installs a cron job, and runs it niced and ioniced.
|
||||||
niceJob :: Desc -> CronTimes -> UserName -> FilePath -> String -> Property
|
niceJob :: Desc -> CronTimes -> UserName -> FilePath -> String -> Property
|
||||||
niceJob desc times user cddir command = job desc times user cddir
|
niceJob desc times user cddir command = job desc times user cddir
|
||||||
("nice ionice -c 3 " ++ command)
|
("nice ionice -c 3 sh -c " ++ shellEscape command)
|
||||||
|
|
||||||
-- | Installs a cron job to run propellor.
|
-- | Installs a cron job to run propellor.
|
||||||
runPropellor :: CronTimes -> Property
|
runPropellor :: CronTimes -> Property
|
||||||
|
|
|
@ -348,8 +348,26 @@ githubBackup = propertyList "github-backup box"
|
||||||
, let f = "/home/joey/.github-keys"
|
, let f = "/home/joey/.github-keys"
|
||||||
in File.hasPrivContent f anyContext
|
in File.hasPrivContent f anyContext
|
||||||
`onChange` File.ownerGroup f "joey" "joey"
|
`onChange` File.ownerGroup f "joey" "joey"
|
||||||
|
, Cron.niceJob "github-backup run" "30 4 * * *" "joey"
|
||||||
|
"/home/joey/lib/backup" $ intercalate "&"
|
||||||
|
[ "mkdir -p github"
|
||||||
|
, "cd github"
|
||||||
|
, "$HOME/.github-keys && github-backup joeyh"
|
||||||
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
rsyncNetBackup :: [Host] -> Property
|
||||||
|
rsyncNetBackup hosts = Cron.niceJob "rsync.net copied in daily" "30 5 * * *"
|
||||||
|
"joey" "/home/joey/lib/backup" "mkdir -p rsync.net && rsync --delete -az 2318@usw-s002.rsync.net: rsync.net"
|
||||||
|
`requires` Ssh.knownHost hosts "usw-s002.rsync.net" "joey"
|
||||||
|
|
||||||
|
backupsBackedupTo :: [Host] -> HostName -> FilePath -> Property
|
||||||
|
backupsBackedupTo hosts desthost destdir = Cron.niceJob "backups copied to usbackup weekly"
|
||||||
|
"1 1 * * 3" "joey" "/" cmd
|
||||||
|
`requires` Ssh.knownHost hosts desthost "joey"
|
||||||
|
where
|
||||||
|
cmd = "rsync -az --delete /home/joey/lib/backup " ++ desthost ++ ":" ++ destdir
|
||||||
|
|
||||||
obnamRepos :: [String] -> Property
|
obnamRepos :: [String] -> Property
|
||||||
obnamRepos rs = propertyList ("obnam repos for " ++ unwords rs)
|
obnamRepos rs = propertyList ("obnam repos for " ++ unwords rs)
|
||||||
(mkbase : map mkrepo rs)
|
(mkbase : map mkrepo rs)
|
||||||
|
@ -360,3 +378,8 @@ obnamRepos rs = propertyList ("obnam repos for " ++ unwords rs)
|
||||||
mkdir d = File.dirExists d
|
mkdir d = File.dirExists d
|
||||||
`before` File.ownerGroup d "joey" "joey"
|
`before` File.ownerGroup d "joey" "joey"
|
||||||
|
|
||||||
|
podcatcher :: Property
|
||||||
|
podcatcher = Cron.niceJob "podcatcher run hourly" "55 * * * *"
|
||||||
|
"joey" "/home/joey/lib/sound/podcasts"
|
||||||
|
"xargs git-annex importfeed -c annex.genmetadata=true < feeds; mr --quiet update"
|
||||||
|
`requires` Apt.installed ["git-annex"]
|
||||||
|
|
Loading…
Reference in New Issue