Added backup script for ejabberd

This commit is contained in:
Ossi Salmi 2011-12-08 14:59:10 +02:00 committed by Timo Mkinen
parent 206392dd67
commit 431034bf47
2 changed files with 89 additions and 0 deletions

View file

@ -139,3 +139,44 @@ class ejabberd {
configwebhost { $ejabberd_webhosts: }
}
}
# Install ejabberd backup cron script.
#
# === Global variables
#
# $ejabberd_backup_datadir:
# Path where to store the backups.
#
class ejabberd::backup {
if ! $ejabberd_backup_datadir {
$ejabberd_backup_datadir = "/srv/ejabberd-backup"
}
file { "${ejabberd_backup_datadir}":
ensure => directory,
mode => 0700,
owner => root,
group => root,
}
file { "/usr/local/sbin/ejabberd-backup":
ensure => present,
content => template("ejabberd/ejabberd-backup.erb"),
mode => 0755,
owner => root,
group => root,
}
cron { "ejabberd-backup":
ensure => present,
command => "/usr/local/sbin/ejabberd-backup",
user => "root",
minute => 15,
hour => 21,
require => File[ "${ejabberd_backup_datadir}",
"/usr/local/sbin/ejabberd-backup" ],
}
}