diff --git a/postgres-docker/Dockerfile b/postgres-docker/Dockerfile index 7217826bb..de114253b 100644 --- a/postgres-docker/Dockerfile +++ b/postgres-docker/Dockerfile @@ -2,9 +2,9 @@ FROM postgres:latest # crontab RUN mkdir /backups -COPY ./db_backup.sh /backups -COPY ./db-backups-cron /etc/cron.d/db-backups-cron +COPY ./backup.sh /backups +COPY ./cronfile /etc/cron.d/cronfile RUN apt-get update && apt-get -y install cron -RUN chmod 0644 /etc/cron.d/db-backups-cron -RUN crontab /etc/cron.d/db-backups-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 new file mode 100755 index 000000000..ab96b37e8 --- /dev/null +++ b/postgres-docker/backup.sh @@ -0,0 +1,3 @@ +#!/bin/bash +filename=backup__$(date +%F) +pg_dump -U fedireads > /backups/$filename.sql diff --git a/postgres-docker/db-backups-cron b/postgres-docker/cronfile similarity index 100% rename from postgres-docker/db-backups-cron rename to postgres-docker/cronfile diff --git a/postgres-docker/db_backup.sh b/postgres-docker/db_backup.sh deleted file mode 100755 index ef0e706db..000000000 --- a/postgres-docker/db_backup.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -filename=backup__$(date +%F) -pg_dump -U fedireads > $filename.sql