From 2e9574d53c30718223bdc2d8fc57d1ab5634e0bb Mon Sep 17 00:00:00 2001 From: Joel Bradshaw Date: Tue, 28 Dec 2021 14:17:23 -0800 Subject: [PATCH] Add database to filename, don't install recommends Cron comes with just a metric ton of recommended dependencies including mariadb-common which is just a bunch of unneccessary weight. Just install what's necessary for cron. --- postgres-docker/Dockerfile | 2 +- postgres-docker/backup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/postgres-docker/Dockerfile b/postgres-docker/Dockerfile index 48d6c2a5..0ec1ba66 100644 --- a/postgres-docker/Dockerfile +++ b/postgres-docker/Dockerfile @@ -5,7 +5,7 @@ RUN mkdir /backups COPY ./backup.sh /backups COPY ./weed.sh /backups COPY ./cronfile /etc/cron.d/cronfile -RUN apt-get update && apt-get -y install cron +RUN apt-get update && apt-get -y --no-install-recommends install cron RUN chmod 0644 /etc/cron.d/cronfile RUN crontab /etc/cron.d/cronfile RUN touch /var/log/cron.log diff --git a/postgres-docker/backup.sh b/postgres-docker/backup.sh index 0df92400..9b65ad87 100755 --- a/postgres-docker/backup.sh +++ b/postgres-docker/backup.sh @@ -3,5 +3,5 @@ if [ -z "$POSTGRES_DB" ]; then echo "Database not specified, defaulting to bookwyrm" fi BACKUP_DB=${POSTGRES_DB:-bookwyrm} -filename=backup__$(date +%F) +filename=backup_${BACKUP_DB}_$(date +%F) pg_dump -U $BACKUP_DB > /backups/$filename.sql