Move _ansible directory into main directory
This commit is contained in:
parent
519882db43
commit
40742e3214
124 changed files with 246 additions and 141 deletions
roles/backup/files
3
roles/backup/files/Dockerfile
Normal file
3
roles/backup/files/Dockerfile
Normal file
|
@ -0,0 +1,3 @@
|
|||
FROM restic/restic
|
||||
|
||||
RUN apk add curl
|
4
roles/backup/files/backup.timer
Normal file
4
roles/backup/files/backup.timer
Normal file
|
@ -0,0 +1,4 @@
|
|||
[Timer]
|
||||
OnCalendar=*-*-* 04:10:00
|
||||
[Install]
|
||||
WantedBy=timers.target
|
30
roles/backup/files/docker-compose.yml
Normal file
30
roles/backup/files/docker-compose.yml
Normal file
|
@ -0,0 +1,30 @@
|
|||
version: "3.7"
|
||||
|
||||
services:
|
||||
backup:
|
||||
build:
|
||||
context: .
|
||||
image: backup
|
||||
restart: never
|
||||
env_file:
|
||||
- service.env
|
||||
volumes:
|
||||
- /tmp/backup-misc:/backup/misc
|
||||
- gitea_data:/backup/volumes/gitea_data
|
||||
- influxdb_data:/backup/volumes/influxdb_data
|
||||
- reitanlage_data:/backup/volumes/reitanlage_data
|
||||
- synapse_media_store:/backup/volumes/synapse_media_store
|
||||
- tandoor_mediafiles:/backup/volumes/tandoor_mediafiles
|
||||
command: restic backup /backup
|
||||
|
||||
volumes:
|
||||
gitea_data:
|
||||
external: true
|
||||
influxdb_data:
|
||||
external: true
|
||||
reitanlage_data:
|
||||
external: true
|
||||
synapse_media_store:
|
||||
external: true
|
||||
tandoor_mediafiles:
|
||||
external: true
|
3
roles/backup/files/node001/mailcow.sh
Executable file
3
roles/backup/files/node001/mailcow.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
export MAILCOW_BACKUP_LOCATION="$BACKUP_LOCATION/mailcow"
|
||||
mkdir -p "$MAILCOW_BACKUP_LOCATION"
|
||||
/opt/mailcow-dockerized/helper-scripts/backup_and_restore.sh backup all
|
14
roles/backup/files/node002/postgres.sh
Executable file
14
roles/backup/files/node002/postgres.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
mkdir -p "$BACKUP_LOCATION/postgres"
|
||||
cd "$BACKUP_LOCATION/postgres" || exit
|
||||
|
||||
postgres_tables=$(sudo -u postgres psql -Atc "SELECT datname FROM pg_database WHERE datistemplate = false;")
|
||||
|
||||
for i in $postgres_tables
|
||||
do
|
||||
printf "dumping %s ..." "$i"
|
||||
sudo -u postgres pg_dump "$i" | gzip >"pg_dump_$i.gz"
|
||||
echo " done"
|
||||
done
|
||||
|
||||
echo "dumping all"
|
||||
sudo -u postgres pg_dumpall | gzip >"pg_dumpall.gz"
|
Reference in a new issue