Filip Pytloun | 311d79c | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 1 | |
Ales Komarek | 7c8d2c9 | 2017-02-21 12:18:05 +0100 | [diff] [blame] | 2 | =================== |
| 3 | Backupninja formula |
| 4 | =================== |
Filip Pytloun | 311d79c | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 5 | |
Ales Komarek | 7c8d2c9 | 2017-02-21 12:18:05 +0100 | [diff] [blame] | 6 | Backupninja allows you to coordinate system backup by dropping a few simple |
| 7 | configuration files into /etc/backup.d/. Most programs you might use for |
| 8 | making backups don't have their own configuration file format. |
Filip Pytloun | 311d79c | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 9 | |
Ales Komarek | 7c8d2c9 | 2017-02-21 12:18:05 +0100 | [diff] [blame] | 10 | Backupninja provides a centralized way to configure and schedule many |
| 11 | different backup utilities. It allows for secure, remote, incremental |
| 12 | filesytem backup (via rdiff-backup), compressed incremental data, backup |
| 13 | system and hardware info, encrypted remote backups (via duplicity), safe |
| 14 | backup of MySQL/PostgreSQL databases, subversion or trac repositories, burn |
| 15 | CD/DVDs or create ISOs, incremental rsync with hardlinking. |
| 16 | |
Filip Pytloun | 311d79c | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 17 | |
| 18 | Sample pillars |
| 19 | ============== |
| 20 | |
| 21 | Backup client with ssh/rsync remote target |
| 22 | |
jan kaufman | d631551 | 2016-02-03 21:19:09 +0100 | [diff] [blame] | 23 | .. code-block:: yaml |
| 24 | |
Filip Pytloun | 311d79c | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 25 | backupninja: |
| 26 | client: |
| 27 | enabled: true |
| 28 | target: |
| 29 | engine: rsync |
| 30 | host: 10.10.10.208 |
| 31 | user: backupninja |
| 32 | |
Jiri Broulik | 1b693c6 | 2018-03-02 15:15:46 +0100 | [diff] [blame] | 33 | Backup 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 Broulik | a0bab44 | 2018-03-02 18:16:13 +0100 | [diff] [blame] | 43 | home_dir: /srv/volumes/backup/backupninja |
Jiri Broulik | 1b693c6 | 2018-03-02 15:15:46 +0100 | [diff] [blame] | 44 | host: 10.10.10.208 |
| 45 | user: backupninja |
| 46 | |
Filip Pytloun | 311d79c | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 47 | Backup client with s3 remote target |
| 48 | |
jan kaufman | d631551 | 2016-02-03 21:19:09 +0100 | [diff] [blame] | 49 | .. code-block:: yaml |
| 50 | |
Filip Pytloun | 311d79c | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 51 | backupninja: |
| 52 | client: |
| 53 | enabled: true |
| 54 | target: |
Michael KutĂ˝ | 4896b92 | 2016-10-23 22:52:40 +0200 | [diff] [blame] | 55 | engine: dup |
| 56 | url: s3+http://bucket-name/folder-name |
| 57 | auth: |
| 58 | awsaccesskeyid: awsaccesskeyid |
| 59 | awssecretaccesskey: awssecretaccesskey |
Filip Pytloun | 311d79c | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 60 | |
jan kaufman | c1b2159 | 2016-01-28 14:03:03 +0100 | [diff] [blame] | 61 | Backup client with webdav target |
| 62 | |
jan kaufman | d631551 | 2016-02-03 21:19:09 +0100 | [diff] [blame] | 63 | .. code-block:: yaml |
| 64 | |
jan kaufman | c1b2159 | 2016-01-28 14:03:03 +0100 | [diff] [blame] | 65 | backupninja: |
| 66 | client: |
| 67 | enabled: true |
| 68 | target: |
Filip Pytloun | 7306f70 | 2016-02-05 17:31:18 +0100 | [diff] [blame] | 69 | engine: dup |
Filip Pytloun | 6ce66eb | 2016-02-05 17:03:00 +0100 | [diff] [blame] | 70 | url: webdavs://backup.cloud.example.com/box.example.com/ |
jan kaufman | 0b9fdb5 | 2016-02-04 15:55:08 +0100 | [diff] [blame] | 71 | auth: |
| 72 | gss: |
| 73 | principal: host/${linux:network:fqdn} |
| 74 | keytab: /etc/krb5.keytab |
jan kaufman | c1b2159 | 2016-01-28 14:03:03 +0100 | [diff] [blame] | 75 | |
Martin Polreich | 41ee69c | 2018-03-05 13:17:02 +0100 | [diff] [blame] | 76 | Backup client with exact backup times |
| 77 | |
Martin Polreich | 41ee69c | 2018-03-05 13:17:02 +0100 | [diff] [blame] | 78 | .. 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 Polreich | 41ee69c | 2018-03-05 13:17:02 +0100 | [diff] [blame] | 89 | .. 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 Polreich | ef70a88 | 2018-04-06 10:48:32 +0200 | [diff] [blame] | 100 | Backup client with defined number of backups to keep |
Martin Polreich | ed7b5c9 | 2018-03-21 11:49:37 +0100 | [diff] [blame] | 101 | |
| 102 | ..code-block:: yaml |
| 103 | |
| 104 | backupninja: |
| 105 | client: |
| 106 | enabled: true |
Martin Polreich | ef70a88 | 2018-04-06 10:48:32 +0200 | [diff] [blame] | 107 | target: |
Martin Polreich | ed7b5c9 | 2018-03-21 11:49:37 +0100 | [diff] [blame] | 108 | engine: rsync |
| 109 | host: 10.10.10.208 |
| 110 | user: backupninja |
| 111 | keep: 4 |
| 112 | |
Filip Pytloun | 311d79c | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 113 | Backup server rsync/rdiff |
| 114 | |
jan kaufman | d631551 | 2016-02-03 21:19:09 +0100 | [diff] [blame] | 115 | .. code-block:: yaml |
| 116 | |
Filip Pytloun | 311d79c | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 117 | backupninja: |
| 118 | server: |
| 119 | enabled: true |
| 120 | rdiff: true |
Ales Komarek | 7c8d2c9 | 2017-02-21 12:18:05 +0100 | [diff] [blame] | 121 | key: |
| 122 | client1.domain.com: |
Jiri Broulik | 7071533 | 2017-04-27 22:04:41 +0200 | [diff] [blame] | 123 | enabled: true |
Ales Komarek | 7c8d2c9 | 2017-02-21 12:18:05 +0100 | [diff] [blame] | 124 | key: ssh-key |
Filip Pytloun | 311d79c | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 125 | |
Jiri Broulik | 34dc3da | 2018-02-27 11:07:11 +0100 | [diff] [blame] | 126 | Backup server without strict client policy restriction |
| 127 | |
| 128 | .. code-block:: yaml |
| 129 | |
| 130 | backupninja: |
| 131 | server: |
| 132 | restrict_clients: false |
Ales Komarek | 7c8d2c9 | 2017-02-21 12:18:05 +0100 | [diff] [blame] | 133 | |
Andrey | 21ff902 | 2017-10-12 09:54:09 -0500 | [diff] [blame] | 134 | Backup client with local storage |
| 135 | |
| 136 | .. code-block:: yaml |
| 137 | |
| 138 | backupninja: |
| 139 | client: |
| 140 | enabled: true |
| 141 | target: |
| 142 | engine: local |
| 143 | |
Jaroslav Steinhaisl | 5a7068b | 2018-02-22 11:13:02 +0100 | [diff] [blame] | 144 | |
| 145 | Client scheduling in rsync engine |
| 146 | ================================= |
| 147 | |
| 148 | Client 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 | |
| 162 | Client 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 Steinhaisl | 7bfb0d8 | 2018-03-23 12:52:07 +0100 | [diff] [blame] | 174 | - Tuesday at 05:30 |
Jaroslav Steinhaisl | 5a7068b | 2018-02-22 11:13:02 +0100 | [diff] [blame] | 175 | - 25 at 23:45 |
| 176 | - hourly |
| 177 | |
Pavel Cizinsky | e4f55a4 | 2019-03-20 16:35:34 +0100 | [diff] [blame] | 178 | Enable color for debug logs |
| 179 | |
| 180 | .. code-block:: yaml |
| 181 | |
| 182 | backupninja: |
| 183 | client: |
| 184 | enabled: true |
| 185 | log: |
| 186 | color: true |
| 187 | |
Jaroslav Steinhaisl | 5a7068b | 2018-02-22 11:13:02 +0100 | [diff] [blame] | 188 | If 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. |
| 189 | |
| 190 | |
Ales Komarek | 7c8d2c9 | 2017-02-21 12:18:05 +0100 | [diff] [blame] | 191 | More information |
| 192 | ================ |
Filip Pytloun | 311d79c | 2015-10-06 16:28:31 +0200 | [diff] [blame] | 193 | |
| 194 | * https://labs.riseup.net/code/projects/backupninja/wiki/Configuration |
| 195 | * http://www.debian-administration.org/articles/351 |
| 196 | * http://duncanlock.net/blog/2013/08/27/comprehensive-linux-backups-with-etckeeper-backupninja/ |
| 197 | * https://github.com/riseuplabs/puppet-backupninja |
| 198 | * http://www.ushills.co.uk/2008/02/backup-with-backupninja.html |