aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/backup.d/example.ldap20
-rw-r--r--etc/backup.d/example.mysql47
-rw-r--r--etc/backup.d/example.rdiff52
-rw-r--r--etc/backup.d/example.sh2
-rw-r--r--etc/backupninja.conf30
-rw-r--r--etc/cron.d/backupninja2
-rw-r--r--etc/logrotate.d/backupninja6
7 files changed, 159 insertions, 0 deletions
diff --git a/etc/backup.d/example.ldap b/etc/backup.d/example.ldap
new file mode 100644
index 0000000..4491d12
--- /dev/null
+++ b/etc/backup.d/example.ldap
@@ -0,0 +1,20 @@
+##
+## configuration file for openldap backups
+##
+## The LDIFs generated are suitable for use with slapadd. As the
+## entries are in database order, not superior first order, they
+## cannot be loaded with ldapadd without being reordered.
+##
+
+## backupdir (default /var/backups/ldap): the destination for the backups
+# backupdir = /var/backups/ldap
+
+## conf (default /etc/ldap/slapd.conf): the location of the slapd.conf file.
+# conf = /etc/ldap/slapd.conf
+
+## databases (default all): either a space separated list of database
+## numbers or prefixes, or the keyword 'all'.
+# databases = all
+
+## compress (default yes): if set to yes, ldif exports are gzipped.
+# compress = yes
diff --git a/etc/backup.d/example.mysql b/etc/backup.d/example.mysql
new file mode 100644
index 0000000..1c08fd3
--- /dev/null
+++ b/etc/backup.d/example.mysql
@@ -0,0 +1,47 @@
+dbusername = root
+dbpassword = test
+dbhost = localhost
+databases = all
+backupdir = /var/backups/mysql
+hotcopy = yes
+sqldump = yes
+compress = yes
+
+#
+# user = <user>
+# Run mysql commands as 'user'. A valid .my.cnf must exist with a
+# database username and password in the user's home directory.
+# If this option is not set, use dbusername and dbpassword instead.
+#
+# dbusername = <dbuser>
+# The user must have access to the databases specified later.
+# Use this option if not using the 'user' option.
+#
+# dbpassword = <dbpass>
+# The password. this password will NOT be passed on the command line
+# and is not readable using "ps aux". make sure that this file is not
+# world readable. Use this to specify the password in this config file
+# instead of ~user/.my.cnf.
+#
+# dbhost = <host>
+# only localhost works right now.
+#
+# databases = < all | db1 db2 db3 >
+# which databases to backup. should either be the word 'all' or a
+# comma seperated list of database names.
+#
+# backupdir = < path/to/destination >
+# where to dump the backups. hotcopy backups will be in a subdirectory 'hotcopy' and
+# sqldump backups will be in a subdirectory 'sqldump'
+#
+# hotcopy = < yes | no >
+# make a backup of the actual database binary files using mysqlhotcopy.
+#
+# sqldump = < yes | no >
+# make a backup using mysqldump. this creates text files with sql commands
+# sufficient to recontruct the database.
+#
+# compress = < yes | no >
+# if yes, compress the sqldump output.
+#
+
diff --git a/etc/backup.d/example.rdiff b/etc/backup.d/example.rdiff
new file mode 100644
index 0000000..f0b9afb
--- /dev/null
+++ b/etc/backup.d/example.rdiff
@@ -0,0 +1,52 @@
+
+######################################################
+## source section
+## (where the files to be backed up are coming from)
+
+[source]
+
+# an optional subdirectory below 'directory' (see [dest])
+label = thishostname
+
+# only local type is currently supported
+type = local
+
+# how many days of data to keep
+keep = 185
+
+# files to include in the backup
+# (supports globbing with '*')
+include = /var/spool/cron/crontabs
+include = /var/backups
+include = /etc
+include = /root
+include = /home
+include = /usr/local/bin
+include = /usr/local/sbin
+include = /var/lib/dpkg/status
+include = /var/lib/dpkg/status-old
+
+# files to exclude from the backup
+# (supports globbing with '*')
+#exclude = /home/*/.gnupg
+
+######################################################
+## destination section
+## (where the files are copied to)
+
+[dest]
+
+# only remote type is currently supported
+type = remote
+
+# the machine which will receive the backups
+host = backuphost
+
+# put the backups under this directory
+directory = /backups
+
+# make the files owned by this user
+# note: you must be able to ssh backupuser@backhost
+# without specifying a password
+user = backupuser
+
diff --git a/etc/backup.d/example.sh b/etc/backup.d/example.sh
new file mode 100644
index 0000000..f02f026
--- /dev/null
+++ b/etc/backup.d/example.sh
@@ -0,0 +1,2 @@
+
+dpkg --get-selections > /var/backups/dpkg-selections.txt
diff --git a/etc/backupninja.conf b/etc/backupninja.conf
new file mode 100644
index 0000000..4d1b63d
--- /dev/null
+++ b/etc/backupninja.conf
@@ -0,0 +1,30 @@
+#
+# |\_
+# B A C K U P N I N J A /()/
+# `\|
+# main configuration file
+#
+
+# how verbose to make the logs
+# 5 -- Debugging messages (and below)
+# 4 -- Informational messages (and below)
+# 3 -- Warnings (and below)
+# 2 -- Errors (and below)
+# 1 -- Fatal errors (only)
+loglevel = 4
+
+# send a summary of backup status to this email address
+# reportemail = root
+
+#######################################################
+# for most installations, the defaults below are good #
+#######################################################
+
+# where to log:
+logfile = /var/log/backupninja.log
+
+# directory where all the backup configuration files live
+configdirectory = /etc/backup.d
+
+# where backupninja helper scripts are found
+scriptdirectory = /usr/share/backupninja
diff --git a/etc/cron.d/backupninja b/etc/cron.d/backupninja
new file mode 100644
index 0000000..e7dde82
--- /dev/null
+++ b/etc/cron.d/backupninja
@@ -0,0 +1,2 @@
+# cron job for backupninja (once a day)
+00 01 * * * root if [ -x /usr/sbin/backupninja -a -f /etc/backupninja.conf ]; then /usr/sbin/backupninja; fi
diff --git a/etc/logrotate.d/backupninja b/etc/logrotate.d/backupninja
new file mode 100644
index 0000000..f8ca298
--- /dev/null
+++ b/etc/logrotate.d/backupninja
@@ -0,0 +1,6 @@
+/var/log/backupninja.log {
+ rotate 6
+ monthly
+ compress
+ missingok
+}