Compare commits

..

No commits in common. "master" and "v0.0.1" have entirely different histories.

2 changed files with 5 additions and 10 deletions

View File

@ -1,4 +1,4 @@
FROM mariadb:10.3.25
FROM mariadb:10.6.23
# Install rclone (ignore apt update errors from old repos)
RUN apt-get update || true && \

View File

@ -11,7 +11,7 @@ KEEP_BACKUPS="${KEEP_BACKUPS:-7}"
S3_BUCKET="${S3_BUCKET:-selectel:backup_db}"
S3_PATH="${S3_PATH:-dot}"
ENVIRONMENT="${ENVIRONMENT:-prod}"
SLEEP=${SLEEP:-43200}
while true; do
echo "[$(date)] Starting database backup process..."
@ -20,7 +20,7 @@ while true; do
if [ $? -ne 0 ]; then
echo "[$(date)] ERROR: Failed to get database list!"
sleep ${SLEEP}
sleep 43200
continue
fi
@ -32,7 +32,7 @@ while true; do
echo "[$(date)] Backing up database: ${database}..."
# Create backup with compression (MariaDB compatible)
# Create backup with compression
mysqldump -h "${DB_HOST}" \
-u"${DB_USER}" \
-p"${DB_PASSWORD}" \
@ -42,11 +42,6 @@ while true; do
--extended-insert \
--quick \
--lock-tables=false \
--skip-add-locks \
--skip-comments \
--routines \
--triggers \
--events \
"${database}" | gzip -c > "${BACKUP_FILE}"
if [ $? -eq 0 ]; then
@ -85,7 +80,7 @@ while true; do
echo "[$(date)] Current local backups:"
ls -lah ${BACKUP_DIR}/*.sql.gz 2>/dev/null || echo "No backups found"
echo "[$(date)] Next backup will run in $((${SLEEP} / 60 / 60 )) hours..."
echo "[$(date)] Next backup will run in 12 hours..."
echo "========================================="
# Sleep for 12 hours (43200 seconds)