]> git.somenet.org - root/pub/somesible.git/blob - roles/base/backup/files/default/backup.conf.managed
roles/base/backup/files
[root/pub/somesible.git] / roles / base / backup / files / default / backup.conf.managed
1 #
2 ################################################
3 ### Managed by someone's ansible provisioner ###
4 ################################################
5 # Part of: https://git.somenet.org/root/pub/somesible.git
6 # 2017-2026 by someone <someone@somenet.org>
7 #
8 # Mind the pruning logic.
9 ## We keep 2.5 years of backups.
10 #
11 # replace "PASSPHRASE_CHANGEME" with something useful, or delete/empty it for no encryption.
12 #
13 # TODO: after 2027-01-01: get rid of "folder names *2"
14
15 # postgresql backup
16 #backup_cmd2 "ssh://backup/POSTGRES/_GLOBAL_" "$(hostname -f)--POSTGRES" "sudo -u postgres -- pg_dumpall --globals-only" "-d13 -w7 -m29" "PASSPHRASE_CHANGEME"
17 #for dbname in `echo "SELECT datname FROM pg_database WHERE datname not in ('template0', 'template1', 'postgres') AND datname not ilike '%_NOBKP' ORDER BY datname" | sudo -u postgres psql -A -P tuples_only=true` ; do
18 #    backup_cmd2 "ssh://backup/POSTGRES/$dbname" "$(hostname -f)--POSTGRES-$dbname" "sudo -u postgres -- pg_dump --clean --if-exists --create $dbname" "-d13 -w7 -m29" "PASSPHRASE_CHANGEME"
19 #done
20
21
22 # mysql backup (borgbackup 1)
23 #for dbname in `echo "select distinct TABLE_SCHEMA from information_schema.tables where TABLE_SCHEMA not in ('information_schema', 'performance_schema', 'sys');" | mysql -B --column-names=false` ; do
24 #    backup_cmd2 "/bkp/storage-local/$(hostname -s)/MYSQL/$dbname" "$(hostname -f)--MYSQL-$dbname" "mysqldump --single-transaction --quick --add-drop-table --add-drop-trigger $dbname" "-d13 -w7 -m29" "PASSPHRASE_CHANGEME"
25 #done
26
27
28 # local backup (borgbackup 1)
29 #backup "/bkp/storage-local/$(hostname -s)/etc.enc"  "$(hostname -f)" "/etc"  "-d13 -w7 -m29" "PASSPHRASE_CHANGEME"
30 #backup "/bkp/storage-local/$(hostname -s)/etc"      "$(hostname -f)" "/etc"  "-d13 -w7 -m29"
31 #backup "/bkp/storage-local/$(hostname -s)/root"     "$(hostname -f)" "/root" "-d13 -w7 -m29"
32 #backup "/bkp/storage-local/$(hostname -s)/var"      "$(hostname -f)" "/var"  "-d13 -w7 -m29"
33 #backup "/bkp/storage-local/$(hostname -s)/srv"      "$(hostname -f)" "/srv"  "-d13 -w7 -m29"
34
35 # local backup2
36 #backup2 "/bkp/storage-local/$(hostname -s)/etc.enc2"  "$(hostname -f)" "/etc"  "-d13 -w7 -m29" "PASSPHRASE_CHANGEME"
37 backup2 "/bkp/storage-local/$(hostname -s)/etc2"      "$(hostname -f)" "/etc"  "-d13 -w7 -m29"
38 backup2 "/bkp/storage-local/$(hostname -s)/root2"     "$(hostname -f)" "/root" "-d13 -w7 -m29"
39 backup2 "/bkp/storage-local/$(hostname -s)/var2"      "$(hostname -f)" "/var"  "-d13 -w7 -m29"
40 backup2 "/bkp/storage-local/$(hostname -s)/srv2"      "$(hostname -f)" "/srv"  "-d13 -w7 -m29"
41
42 # remote backup
43 #backup2 "ssh://backup/home"    "$(hostname -f)" "/home"    "-d13 -w7 -m6"