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>
8 # Mind the pruning logic.
9 ## We keep 3 years of backups.
13 # replace "PASSPHRASE_CHANGEME" with something useful, or delete/empty it for no encryption.
18 #for dbnum in `seq 1 1 1` ; do
19 # backup_cmd2 "ssh://backup/LDAP/db-$dbnum" "$(hostname -f)--LDAP-$dbnum" "slapcat -n $dbnum" "-d7 -w7 -m35"
23 # postgresql backup (remote + borgbackup2)
24 #backup_cmd2 "ssh://backup/PG/_GLOBAL_" "$(hostname -f)--PG" "sudo -u postgres -- pg_dumpall --globals-only" "-d7 -w7 -m35" "PASSPHRASE_CHANGEME"
25 #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
26 # backup_cmd2 "ssh://backup/PG/$dbname" "$(hostname -f)--PG-$dbname" "sudo -u postgres -- pg_dump --clean --if-exists --create $dbname" "-d7 -w7 -m35" "PASSPHRASE_CHANGEME"
30 # mysql backup (local + borgbackup 1)
31 #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
32 # backup_cmd2 "/bkp/storage-local/$(hostname -s)/MYSQL/$dbname" "$(hostname -f)--MYSQL-$dbname" "mysqldump --single-transaction --quick --add-drop-table --add-drop-trigger $dbname" "-d7 -w7 -m35" "PASSPHRASE_CHANGEME"
36 # backup (local + borgbackup 1)
37 #backup "/bkp/storage-local/$(hostname -s)/etc.enc" "$(hostname -f)" "/etc" "-d7 -w7 -m35" "PASSPHRASE_CHANGEME"
38 #backup "/bkp/storage-local/$(hostname -s)/etc" "$(hostname -f)" "/etc" "-d7 -w7 -m35"
39 #backup "/bkp/storage-local/$(hostname -s)/root" "$(hostname -f)" "/root" "-d7 -w7 -m35"
40 #backup "/bkp/storage-local/$(hostname -s)/var" "$(hostname -f)" "/var" "-d7 -w7 -m35"
41 #backup "/bkp/storage-local/$(hostname -s)/srv" "$(hostname -f)" "/srv" "-d7 -w7 -m35"
43 # backup (local + borgbackup 2)
44 #backup2 "/bkp/storage-local/$(hostname -s)/etc.enc.b2" "$(hostname -f)" "/etc" "-d7 -w7 -m35" "PASSPHRASE_CHANGEME"
45 backup2 "/bkp/storage-local/$(hostname -s)/etc.b2" "$(hostname -f)" "/etc" "-d7 -w7 -m35"
46 backup2 "/bkp/storage-local/$(hostname -s)/root.b2" "$(hostname -f)" "/root" "-d7 -w7 -m35"
47 backup2 "/bkp/storage-local/$(hostname -s)/var.b2" "$(hostname -f)" "/var" "-d7 -w7 -m35"
48 backup2 "/bkp/storage-local/$(hostname -s)/srv.b2" "$(hostname -f)" "/srv" "-d7 -w7 -m35"
50 # backup (remote + borgbackup 2)
51 #backup2 "ssh://backup/home" "$(hostname -f)" "/home.b2" "-d7 -w7 -m5"