parent
06e5ac98d1
commit
7ccb495a1a
|
|
@ -43,7 +43,7 @@ COPY --from=builder /pause/pauser /pauser
|
|||
USER root
|
||||
### CRON BACKUPS
|
||||
RUN true \
|
||||
&& echo 'b=$(date +%Y%m%d%H%M%S) && mkdir -p /mnt/save/$b && pg_dump $DATABASE_URL > /mnt/save/$b/pg.dump' > /backup.sh \
|
||||
&& echo 'b=$(date +%Y%m%d%H%M%S) && mkdir -p /mnt/save/$b && pg_dump $DATABASE_URL --clean > /mnt/save/$b/pg.dump' > /backup.sh \
|
||||
&& echo 'b=$(find /mnt/save -type f | sort | tail -n 1); if [ -n "$b" ]; then echo restoring $b; psql $DATABASE_URL < "$b"; fi && service postgresql start;' > /restore.sh \
|
||||
&& echo '0 4,8,12,16,20 * * * bash /backup.sh >> /var/log/cronj.log 2>&1' > /etc/cron.d/backups \
|
||||
&& echo '' >> /etc/cron.d/backups \
|
||||
|
|
|
|||
Loading…
Reference in New Issue