From dec6f26685f0b31500b1b8f537b75a8d5c8c0fb5 Mon Sep 17 00:00:00 2001 From: Alan Christie Date: Thu, 4 Jan 2024 14:05:34 +0000 Subject: [PATCH] chore: Better log and options --- sql-backup/docker-entrypoint.sh | 6 ++++-- sql-recovery/docker-entrypoint.sh | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sql-backup/docker-entrypoint.sh b/sql-backup/docker-entrypoint.sh index 36212a1..3ca2a1d 100755 --- a/sql-backup/docker-entrypoint.sh +++ b/sql-backup/docker-entrypoint.sh @@ -52,19 +52,21 @@ if [ -v BACKUP_VOLUME_IS_S3 ]; then # i.e. is BACKUP_VOLUME_S3_URL or BACKUP_VOLUME_S3_REQUEST_STYLE defined? S3FS_EXTRA_OPTIONS="" if [ -n "$BACKUP_VOLUME_S3_URL" ]; then + echo "--] s3fs BACKUP_VOLUME_S3_URL=${BACKUP_VOLUME_S3_URL}" S3FS_EXTRA_OPTIONS+="-o url=${BACKUP_VOLUME_S3_URL}" fi if [ -n "$BACKUP_VOLUME_S3_REQUEST_STYLE" ]; then + echo "--] s3fs BACKUP_VOLUME_S3_REQUEST_STYLE=${BACKUP_VOLUME_S3_REQUEST_STYLE}" S3FS_EXTRA_OPTIONS+=" -o ${BACKUP_VOLUME_S3_REQUEST_STYLE}" fi # Create the target directory ('/backup') # and then invoke s3fs mkdir -p /backup - S3FS_CMD_OPTIONS="/backup -o passwd_file=/tmp/.passwd-s3fs ${S3FS_EXTRA_OPTIONS}" + S3FS_CMD_OPTIONS="-o passwd_file=/tmp/.passwd-s3fs ${S3FS_EXTRA_OPTIONS}" echo "--] s3fs AWS_BUCKET_NAME=${AWS_BUCKET_NAME}" echo "--] s3fs S3FS_CMD_OPTIONS=${S3FS_CMD_OPTIONS}" - s3fs ${AWS_BUCKET_NAME} ${S3FS_CMD_OPTIONS} + s3fs ${AWS_BUCKET_NAME} /backup ${S3FS_CMD_OPTIONS} # And then wait (to avoid weird /backup root directories not existing) echo "--] Sleeping for 4 seconds..." diff --git a/sql-recovery/docker-entrypoint.sh b/sql-recovery/docker-entrypoint.sh index 5090eba..439453c 100755 --- a/sql-recovery/docker-entrypoint.sh +++ b/sql-recovery/docker-entrypoint.sh @@ -52,19 +52,21 @@ if [ -v BACKUP_VOLUME_IS_S3 ]; then # i.e. is BACKUP_VOLUME_S3_URL or BACKUP_VOLUME_S3_REQUEST_STYLE defined? S3FS_EXTRA_OPTIONS="" if [ -n "$BACKUP_VOLUME_S3_URL" ]; then + echo "--] s3fs BACKUP_VOLUME_S3_URL=${BACKUP_VOLUME_S3_URL}" S3FS_EXTRA_OPTIONS+="-o url=${BACKUP_VOLUME_S3_URL}" fi if [ -n "$BACKUP_VOLUME_S3_REQUEST_STYLE" ]; then + echo "--] s3fs BACKUP_VOLUME_S3_REQUEST_STYLE=${BACKUP_VOLUME_S3_REQUEST_STYLE}" S3FS_EXTRA_OPTIONS+=" -o ${BACKUP_VOLUME_S3_REQUEST_STYLE}" fi # Create the target directory ('/backup') # and then invoke s3fs mkdir -p /backup - S3FS_CMD_OPTIONS="/backup -o passwd_file=/tmp/.passwd-s3fs ${S3FS_EXTRA_OPTIONS}" + S3FS_CMD_OPTIONS="-o passwd_file=/tmp/.passwd-s3fs ${S3FS_EXTRA_OPTIONS}" echo "--] s3fs AWS_BUCKET_NAME=${AWS_BUCKET_NAME}" echo "--] s3fs S3FS_CMD_OPTIONS=${S3FS_CMD_OPTIONS}" - s3fs ${AWS_BUCKET_NAME} ${S3FS_CMD_OPTIONS} + s3fs ${AWS_BUCKET_NAME} /backup ${S3FS_CMD_OPTIONS} # And then wait (to avoid weird /backup root directories not existing) echo "--] Sleeping for 4 seconds..."