sunetdrive/templates/scriptreceiver/backup_db.erb.sh

18 lines
452 B
Bash
Raw Normal View History

2023-02-13 09:44:56 +00:00
#!/bin/bash
container="${1}"
customer="${2}"
if [[ -z ${container} ]]; then
2023-03-10 09:19:05 +00:00
container="mariadb_backup_mariadb_backup_1"
2023-02-13 09:44:56 +00:00
fi
if [[ -z ${customer} ]]; then
backupdir="/opt/mariadb_backup/backups/"
else
backupdir="/opt/multinode/${customer}/mariadb-${customer}/backups/"
fi
docker exec ${container} /do_backup.sh ${customer}
2023-06-13 10:09:13 +00:00
chown root:script /opt/mariadb_backup/
chmod 750 /opt/mariadb_backup/
2023-02-13 09:44:56 +00:00
chmod 755 ${backupdir}
chown -R script:root ${backupdir}