1{
2    "temp_dir" :  "/var/tmp",
3
4    "compression" :
5    {
6        "algorithm"            : "lzma2",
7        "level"                : "6e",
8        "preserve_permissions" : "yes"
9    },
10
11    "security" :
12    {
13        "checksum_algorithm" :  "sha512",
14
15        "encryption" :
16        {
17            "enable"                    :  "yes",
18            "key_size"                  :  "256",
19            "base64_encode"             :  "no",
20            "passphrase"                :  "",
21            "random_passphrase_pattern" :  "print",
22            "random_passphrase_length"  :  128,
23            "private_key"               :  "~/keys/private.pem"
24        }
25    },
26
27    "reports" :
28    {
29        "mailboxes" :
30        [
31            {
32                "email_address"      :  "backups.archive@babaei.net",
33                "attach_passphrases" :  "yes"
34            },
35            {
36                "email_address"      :  "backups.verify@babaei.net",
37                "attach_passphrases" :  "no"
38            }
39        ],
40
41        "subject" :
42        {
43            "success" :  "[{HOST_NAME} {DATE}] BACKUP REPORT / SUCCESS",
44            "error"   :  "[{HOST_NAME} {DATE}] BACKUP REPORT / ERROR",
45            "fatal"   :  "[{HOST_NAME} {DATE}] BACKUP REPORT / FATAL ERROR"
46        },
47
48        "support_info" :  "Have question or need technical assistance, please visit http://www.babaei.net/ or write an email to info [ at ] babaei.net."
49    },
50
51    "remote" :
52    {
53        "keep_backup_locally" :  "partial",
54
55        "servers" :
56        [
57            {
58                "host"                :  "10.12.0.4",
59                "port"                :  "22",
60                "user"                :  "babaei",
61                "dir"                 :  "~/backups/{HOST_NAME}",
62                "backups_to_preserve" :  7,
63                "public_key"          :  "~/keys/10.12.0.4_babaei.pem"
64            },
65            {
66                "host"                :  "example.domain",
67                "port"                :  "8931",
68                "user"                :  "babaei",
69                "dir"                 :  "~/backups/{HOST_NAME}",
70                "backups_to_preserve" :  31,
71                "public_key"          :  "~/keys/example.domain_babaei.pem"
72            }
73        ]
74    },
75
76    "backup" :
77    {
78        "archive_name" :  "{DATE}_{HOST_NAME}_{TAG}",
79
80        "priority_order" :
81        [
82            "openldap",
83            "database",
84            "filesystem",
85            "misc"
86        ],
87
88        "openldap" :
89        {
90            "tag"   :  "openldap-babaei-net",
91            "user"  :  "ldap",
92            "group" :  "ldap",
93            "flags" :  ""
94        },
95
96        "database" :
97        {
98            "priority_order" :
99            [
100                "postgres",
101                "mysql"
102            ],
103
104            "postgres" :
105            {
106                "user"  :  "pgsql",
107                "group" :  "pgsql",
108
109                "databases" :
110                [
111                    {
112                        "tag"     :  "postgres",
113                        "name"    :  "*",
114                        "comment" :  "All PostgreSQL databases"
115                    },
116                    {
117                        "tag"     :  "postgres-gitlab",
118                        "name"    :  "gitlab",
119                        "comment" :  "GitLab database"
120                    },
121                    {
122                        "tag"     :  "postgres-redmine",
123                        "name"    :  "redmine",
124                        "comment" :  "Redmine database"
125                    },
126                    {
127                        "tag"     :  "postgres-agilo",
128                        "name"    :  "agilo",
129                        "comment" :  "Agilo for Trac database"
130                    },
131                    {
132                        "tag"     :  "postgres-owncloud",
133                        "name"    :  "owncloud",
134                        "comment" :  "ownCloud database"
135                    },
136                    {
137                        "tag"     :  "postgres-tracks",
138                        "name"    :  "tracks",
139                        "comment" :  "Get on Tracks database"
140                    }
141                ]
142            },
143
144            "mysql" :
145            {
146                "user"          :  "mysql",
147                "group"         :  "mysql",
148                "internal_user" :  "root",
149
150                "databases" :
151                [
152                    {
153                        "tag"     :  "mysql",
154                        "name"    :  "*",
155                        "comment" :  "All MySQL databases"
156                    },
157                    {
158                        "tag"     :  "mysql-piwik",
159                        "name"    :  "piwik",
160                        "comment" :  "Piwik database"
161                    },
162                    {
163                        "tag"     :  "mysql-osticket",
164                        "name"    :  "osticket",
165                        "comment" :  "Piwik database"
166                    }
167                ]
168            }
169        },
170
171        "filesystem" :
172        [
173            {
174                "tag"             :  "www",
175                "path"            :  "/usr/local/www/nginx",
176                "follow_symlinks" :  "yes",
177                "comment"         :  "Web server root directory"
178            },
179            {
180                "tag"             :  "repos",
181                "path"            :  "/usr/local/gitlab",
182                "follow_symlinks" :  "yes",
183                "comment"         :  "GitLab repositories"
184            },
185            {
186                "tag"             :  "mail",
187                "path"            :  "/usr/local/mail",
188                "follow_symlinks" :  "yes",
189                "comment"         :  "Mail server root directory"
190            },
191            {
192                "tag"             :  "etc-system",
193                "path"            :  "/etc",
194                "follow_symlinks" :  "yes",
195                "comment"         :  "Base system configurations"
196            },
197            {
198                "tag"             :  "etc-ports",
199                "path"            :  "/usr/local/etc",
200                "follow_symlinks" :  "yes",
201                "comment"         :  "Installed ports configurations"
202            },
203            {
204                "tag"             :  "loader-conf",
205                "path"            :  "/boot/loader.conf",
206                "follow_symlinks" :  "yes",
207                "comment"         :  "System bootstrap configuration information"
208            },
209            {
210                "tag"             :  "boot-splash",
211                "path"            :  "/boot/splash.pcx",
212                "follow_symlinks" :  "yes",
213                "comment"         :  "Boot-time splash screen"
214            },
215            {
216                "tag"             :  "slim-fbsd-theme",
217                "path"            :  "/usr/local/share/slim/themes/fbsd",
218                "follow_symlinks" :  "yes",
219                "comment"         :  "FreeBSD SLiM theme"
220            }
221        ],
222
223        "misc" :
224        [
225            {
226                "tag"                   :  "cloudflare-ip-ranges",
227                "command"               :  "/usr/local/www/nginx/cron/cloudflare-ip-ranges-updater.sh",
228                "args"                  :  "ipv4 ipv6",
229                "path"                  :  "/usr/local/www/nginx/include/cloudflare",
230                "follow_symlinks"       :  "yes",
231                "remove_path_when_done" :  "no",
232                "comment"               :  "CloudFlare IP database for nginx RealIP module"
233            }
234        ]
235    },
236
237    "command" :
238    {
239        "basename" :
240        {
241            "return_code" :
242            {
243                "rc_0"   :  "The operation completed successfully.",
244                "rc_any" :  "The operation failed."
245            }
246        },
247
248        "bzip2" :
249        {
250            "return_code" :
251            {
252                "rc_0"   :  "The operation completed successfully.",
253                "rc_any" :  "The operation failed."
254            }
255        },
256
257        "caller" :
258        {
259            "return_code" :
260            {
261                "rc_0"   :  "The operation completed successfully.",
262                "rc_any" :  "The operation failed."
263            }
264        },
265
266        "cat" :
267        {
268            "return_code" :
269            {
270                "rc_0"   :  "The operation completed successfully.",
271                "rc_any" :  "The operation failed."
272            }
273        },
274
275        "cd" :
276        {
277            "return_code" :
278            {
279                "rc_0"   :  "The operation completed successfully.",
280                "rc_any" :  "The operation failed."
281            }
282        },
283
284        "chown" :
285        {
286            "return_code" :
287            {
288                "rc_0"   :  "The operation completed successfully.",
289                "rc_any" :  "The operation failed."
290            }
291        },
292
293        "cut" :
294        {
295            "return_code" :
296            {
297                "rc_0"   :  "The operation completed successfully.",
298                "rc_any" :  "The operation failed."
299            }
300        },
301
302        "date" :
303        {
304            "return_code" :
305            {
306                "rc_0"   :  "The operation completed successfully.",
307                "rc_any" :  "The operation failed."
308            }
309        },
310
311        "du" :
312        {
313            "return_code" :
314            {
315                "rc_0"   :  "The operation completed successfully.",
316                "rc_any" :  "The operation failed."
317            }
318        },
319
320        "dirname" :
321        {
322            "return_code" :
323            {
324                "rc_0"   :  "The operation completed successfully.",
325                "rc_any" :  "The operation failed."
326            }
327        },
328
329        "echo" :
330        {
331            "return_code" :
332            {
333                "rc_0"   :  "The operation completed successfully.",
334                "rc_any" :  "The operation failed."
335            }
336        },
337
338        "expr" :
339        {
340            "return_code" :
341            {
342                "rc_0"   :  "The operation completed successfully.",
343                "rc_any" :  "The operation failed."
344            }
345        },
346
347        "flock" :
348        {
349            "return_code" :
350            {
351                "rc_0"   :  "The operation completed successfully.",
352                "rc_any" :  "The operation failed."
353            }
354        },
355
356        "grep" :
357        {
358            "return_code" :
359            {
360                "rc_0"   :  "The operation completed successfully.",
361                "rc_any" :  "The operation failed."
362            }
363        },
364
365        "gzip" :
366        {
367            "return_code" :
368            {
369                "rc_0"   :  "The operation completed successfully.",
370                "rc_any" :  "The operation failed."
371            }
372        },
373
374        "head" :
375        {
376            "return_code" :
377            {
378                "rc_0"   :  "The operation completed successfully.",
379                "rc_any" :  "The operation failed."
380            }
381        },
382
383        "hostname" :
384        {
385            "return_code" :
386            {
387                "rc_0"   :  "The operation completed successfully.",
388                "rc_any" :  "The operation failed."
389            }
390        },
391
392        "jq" :
393        {
394            "return_code" :
395            {
396                "rc_0"   :  "The operation completed successfully.",
397                "rc_1"   :  "The last output value was either false or null.",
398                "rc_2"   :  "Usage problem or system error.",
399                "rc_3"   :  "Compile error,.",
400                "rc_4"   :  "Parse error.",
401                "rc_any" :  "The operation failed."
402            }
403        },
404
405        "logger" :
406        {
407            "return_code" :
408            {
409                "rc_0"   :  "The operation completed successfully.",
410                "rc_any" :  "The operation failed."
411            }
412        },
413
414        "mail" :
415        {
416            "return_code" :
417            {
418                "rc_0"   :  "The operation completed successfully.",
419                "rc_any" :  "The operation failed."
420            }
421        },
422
423        "mkdir" :
424        {
425            "return_code" :
426            {
427                "rc_0"   :  "The operation completed successfully.",
428                "rc_any" :  "The operation failed."
429            }
430        },
431
432        "mysqldump" :
433        {
434            "return_code" :
435            {
436                "rc_0"   :  "The operation completed successfully.",
437                "rc_any" :  "The operation failed."
438            }
439        },
440
441        "openssl" :
442        {
443            "return_code" :
444            {
445                "rc_0"   :  "The operation completed successfully.",
446                "rc_any" :  "The operation failed."
447            }
448        },
449
450        "pg_dump" :
451        {
452            "return_code" :
453            {
454                "rc_0"   :  "The operation completed successfully.",
455                "rc_any" :  "The operation failed."
456            }
457        },
458
459        "pg_dumpall" :
460        {
461            "return_code" :
462            {
463                "rc_0"   :  "The operation completed successfully.",
464                "rc_any" :  "The operation failed."
465            }
466        },
467
468        "printf" :
469        {
470            "return_code" :
471            {
472                "rc_0"   :  "The operation completed successfully.",
473                "rc_any" :  "The operation failed."
474            }
475        },
476
477        "readlink" :
478        {
479            "return_code" :
480            {
481                "rc_0"   :  "The operation completed successfully.",
482                "rc_any" :  "The operation failed."
483            }
484        },
485
486        "rm" :
487        {
488            "return_code" :
489            {
490                "rc_0"   :  "The operation completed successfully.",
491                "rc_any" :  "The operation failed."
492            }
493        },
494
495        "scp" :
496        {
497            "return_code" :
498            {
499                "rc_0"   :  "Operation was successful.",
500                "rc_1"   :  "General error in file copy.",
501                "rc_2"   :  "Destination is not directory, but it should be.",
502                "rc_3"   :  "Maximum symlink level exceeded.",
503                "rc_4"   :  "Connecting to host failed.",
504                "rc_5"   :  "Connection broken.",
505                "rc_6"   :  "File does not exist.",
506                "rc_7"   :  "No permission to access file.",
507                "rc_8"   :  "General error in sftp protocol.",
508                "rc_9"   :  "File transfer protocol mismatch.",
509                "rc_10"  :  "No file matches a given criteria.",
510                "rc_65"  :  "Host not allowed to connect.",
511                "rc_66"  :  "General error in ssh protocol.",
512                "rc_67"  :  "Key exchange failed.",
513                "rc_68"  :  "Reserved.",
514                "rc_69"  :  "MAC error.",
515                "rc_70"  :  "Compression error.",
516                "rc_71"  :  "Service not available.",
517                "rc_72"  :  "Protocol version not supported.",
518                "rc_73"  :  "Host key not verifiable.",
519                "rc_74"  :  "Connection failed.",
520                "rc_75"  :  "Disconnected by application.",
521                "rc_76"  :  "Too many connections.",
522                "rc_77"  :  "Authentication cancelled by user.",
523                "rc_78"  :  "No more authentication methods available.",
524                "rc_79"  :  "Invalid user name.",
525                "rc_any" :  "Unknown scp error."
526            }
527        },
528
529        "slapcat" :
530        {
531            "return_code" :
532            {
533                "rc_0"   :  "The operation completed successfully.",
534                "rc_any" :  "The operation failed."
535            }
536        },
537
538        "ssh" :
539        {
540            "return_code" :
541            {
542                "rc_0"   :  "Operation was successful.",
543                "rc_1"   :  "Generic error.",
544                "rc_2"   :  "Connection failed.",
545                "rc_10"  :  "No file matches a given criteria.",
546                "rc_65"  :  "Host not allowed to connect.",
547                "rc_66"  :  "General error in ssh protocol.",
548                "rc_67"  :  "Key exchange failed.",
549                "rc_68"  :  "Reserved.",
550                "rc_69"  :  "MAC error.",
551                "rc_70"  :  "Compression error.",
552                "rc_71"  :  "Service not available.",
553                "rc_72"  :  "Protocol version not supported.",
554                "rc_73"  :  "Host key not verifiable.",
555                "rc_74"  :  "Connection failed.",
556                "rc_75"  :  "Disconnected by application.",
557                "rc_76"  :  "Too many connections.",
558                "rc_77"  :  "Authentication cancelled by user.",
559                "rc_78"  :  "No more authentication methods available.",
560                "rc_79"  :  "Invalid user name.",
561                "rc_255" :  "Generic ssh error.",
562                "rc_any" :  "Unknown ssh error."
563            }
564        },
565
566        "strings" :
567        {
568            "return_code" :
569            {
570                "rc_0"   :  "The operation completed successfully.",
571                "rc_any" :  "The operation failed."
572            }
573        },
574
575        "sudo" :
576        {
577            "return_code" :
578            {
579                "rc_0"   :  "The operation completed successfully.",
580                "rc_any" :  "The operation failed."
581            }
582        },
583
584        "tar" :
585        {
586            "return_code" :
587            {
588                "rc_0"   :  "The operation completed successfully.",
589                "rc_any" :  "The operation failed."
590            }
591        },
592
593        "tr" :
594        {
595            "return_code" :
596            {
597                "rc_0"   :  "The operation completed successfully.",
598                "rc_any" :  "The operation failed."
599            }
600        },
601
602        "xz" :
603        {
604            "return_code" :
605            {
606                "rc_0"   :  "The operation completed successfully.",
607                "rc_any" :  "The operation failed."
608            }
609        }
610    }
611}
612
613
614