blob: 863a0f69c300416ca00c1ccf54b5da3b3d003f72 [file] [log] [blame]
Filip Pytloun311d79c2015-10-06 16:28:31 +02001
Ales Komarek7c8d2c92017-02-21 12:18:05 +01002===================
3Backupninja formula
4===================
Filip Pytloun311d79c2015-10-06 16:28:31 +02005
Ales Komarek7c8d2c92017-02-21 12:18:05 +01006Backupninja allows you to coordinate system backup by dropping a few simple
7configuration files into /etc/backup.d/. Most programs you might use for
8making backups don't have their own configuration file format.
Filip Pytloun311d79c2015-10-06 16:28:31 +02009
Ales Komarek7c8d2c92017-02-21 12:18:05 +010010Backupninja provides a centralized way to configure and schedule many
11different backup utilities. It allows for secure, remote, incremental
12filesytem backup (via rdiff-backup), compressed incremental data, backup
13system and hardware info, encrypted remote backups (via duplicity), safe
14backup of MySQL/PostgreSQL databases, subversion or trac repositories, burn
15CD/DVDs or create ISOs, incremental rsync with hardlinking.
16
Filip Pytloun311d79c2015-10-06 16:28:31 +020017
18Sample pillars
19==============
20
21Backup client with ssh/rsync remote target
22
jan kaufmand6315512016-02-03 21:19:09 +010023.. code-block:: yaml
24
Filip Pytloun311d79c2015-10-06 16:28:31 +020025 backupninja:
26 client:
27 enabled: true
28 target:
29 engine: rsync
30 host: 10.10.10.208
31 user: backupninja
32
Jiri Broulik1b693c62018-03-02 15:15:46 +010033Backup client with ssh/rsync remote target with specific rsync options
34
35.. code-block:: yaml
36
37 backupninja:
38 client:
39 enabled: true
40 target:
41 engine: rsync
42 engine_opts: "-av --delete --recursive --safe-links"
Jiri Broulika0bab442018-03-02 18:16:13 +010043 home_dir: /srv/volumes/backup/backupninja
Jiri Broulik1b693c62018-03-02 15:15:46 +010044 host: 10.10.10.208
45 user: backupninja
46
Filip Pytloun311d79c2015-10-06 16:28:31 +020047Backup client with s3 remote target
48
jan kaufmand6315512016-02-03 21:19:09 +010049.. code-block:: yaml
50
Filip Pytloun311d79c2015-10-06 16:28:31 +020051 backupninja:
52 client:
53 enabled: true
54 target:
Michael Kutý4896b922016-10-23 22:52:40 +020055 engine: dup
56 url: s3+http://bucket-name/folder-name
57 auth:
58 awsaccesskeyid: awsaccesskeyid
59 awssecretaccesskey: awssecretaccesskey
Filip Pytloun311d79c2015-10-06 16:28:31 +020060
jan kaufmanc1b21592016-01-28 14:03:03 +010061Backup client with webdav target
62
jan kaufmand6315512016-02-03 21:19:09 +010063.. code-block:: yaml
64
jan kaufmanc1b21592016-01-28 14:03:03 +010065 backupninja:
66 client:
67 enabled: true
68 target:
Filip Pytloun7306f702016-02-05 17:31:18 +010069 engine: dup
Filip Pytloun6ce66eb2016-02-05 17:03:00 +010070 url: webdavs://backup.cloud.example.com/box.example.com/
jan kaufman0b9fdb52016-02-04 15:55:08 +010071 auth:
72 gss:
73 principal: host/${linux:network:fqdn}
74 keytab: /etc/krb5.keytab
jan kaufmanc1b21592016-01-28 14:03:03 +010075
Martin Polreich41ee69c2018-03-05 13:17:02 +010076Backup client with exact backup times
77
Martin Polreich41ee69c2018-03-05 13:17:02 +010078.. code-block:: yaml
79
80 backupninja:
81 client:
82 enabled: true
83 auto_backup_disabled: false
84 backup_times:
85 day_of_week: 1
86 hour: 2
87 minute: 32
88
Martin Polreich41ee69c2018-03-05 13:17:02 +010089.. code-block:: yaml
90
91 backupninja:
92 client:
93 enabled: true
94 auto_backup_disabled: false
95 backup_times:
96 day_of_month: 24
97 hour: 14
98 minute: 12
99
Martin Polreichef70a882018-04-06 10:48:32 +0200100Backup client with defined number of backups to keep
Martin Polreiched7b5c92018-03-21 11:49:37 +0100101
102..code-block:: yaml
103
104 backupninja:
105 client:
106 enabled: true
Martin Polreichef70a882018-04-06 10:48:32 +0200107 target:
Martin Polreiched7b5c92018-03-21 11:49:37 +0100108 engine: rsync
109 host: 10.10.10.208
110 user: backupninja
111 keep: 4
112
Filip Pytloun311d79c2015-10-06 16:28:31 +0200113Backup server rsync/rdiff
114
jan kaufmand6315512016-02-03 21:19:09 +0100115.. code-block:: yaml
116
Filip Pytloun311d79c2015-10-06 16:28:31 +0200117 backupninja:
118 server:
119 enabled: true
120 rdiff: true
Ales Komarek7c8d2c92017-02-21 12:18:05 +0100121 key:
122 client1.domain.com:
Jiri Broulik70715332017-04-27 22:04:41 +0200123 enabled: true
Ales Komarek7c8d2c92017-02-21 12:18:05 +0100124 key: ssh-key
Filip Pytloun311d79c2015-10-06 16:28:31 +0200125
Jiri Broulik34dc3da2018-02-27 11:07:11 +0100126Backup server without strict client policy restriction
127
128.. code-block:: yaml
129
130 backupninja:
131 server:
132 restrict_clients: false
Ales Komarek7c8d2c92017-02-21 12:18:05 +0100133
Andrey21ff9022017-10-12 09:54:09 -0500134Backup client with local storage
135
136.. code-block:: yaml
137
138 backupninja:
139 client:
140 enabled: true
141 target:
142 engine: local
143
Jaroslav Steinhaisl5a7068b2018-02-22 11:13:02 +0100144
145Client scheduling in rsync engine
146=================================
147
148Client run backup at 5am every day.
149
150.. code-block:: yaml
151
152 backupninja:
153 client:
154 enabled: true
155 target:
156 engine: rsync
157 scheduling:
158 when:
159 - everyday at 05
160
161
162Client run backup in mupltiple times.
163
164.. code-block:: yaml
165
166 backupninja:
167 client:
168 enabled: true
169 target:
170 engine: rsync
171 scheduling:
172 when:
173 - everyday at 5
Jaroslav Steinhaisl7bfb0d82018-03-23 12:52:07 +0100174 - Tuesday at 05:30
Jaroslav Steinhaisl5a7068b2018-02-22 11:13:02 +0100175 - 25 at 23:45
176 - hourly
177
178If multiple "when" options are present, then they all apply. If two configurations files are scheduled to run in the same hour, then we fall back on the alphabetical ordering specified above.
179
180
Ales Komarek7c8d2c92017-02-21 12:18:05 +0100181More information
182================
Filip Pytloun311d79c2015-10-06 16:28:31 +0200183
184* https://labs.riseup.net/code/projects/backupninja/wiki/Configuration
185* http://www.debian-administration.org/articles/351
186* http://duncanlock.net/blog/2013/08/27/comprehensive-linux-backups-with-etckeeper-backupninja/
187* https://github.com/riseuplabs/puppet-backupninja
188* http://www.ushills.co.uk/2008/02/backup-with-backupninja.html