This repository has been archived on 2025-06-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
server/configs/mysql_backup.sh

9 lines
333 B
Bash

#!/bin/sh
[ -z "${MYSQL_PASSWORD}" ] && [ -n "${MYSQL_PASSWORD_FILE}" ] && MYSQL_PASSWORD=$(cat "${MYSQL_PASSWORD_FILE}" | tr -d '\n')
while true
do
sleep 360
mysqldump -h "${MYSQL_HOST}" -u "${MYSQL_USER}" --password="${MYSQL_PASSWORD}" "${MYSQL_DATABASE}" | gzip > /var/lib/fic/backups/db-$(date +%Y%m%d%H%M).sql.gz
done