There was an error while loading. Please reload this page.
0 parents commit bb12e2dCopy full SHA for bb12e2d
Dockerfile
@@ -0,0 +1,8 @@
1
+FROM postgres
2
+LABEL maintainer="Mic Szillat <mic@nomaster.cc>"
3
+ADD backup.sh .
4
+ENV PGHOST=db
5
+ENV PGUSER=postgres
6
+ENV PGPASSWORD=postgres
7
+VOLUME /backup
8
+CMD ./backup.sh
backup.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+while true
+do
+ DATE=$(date +%y.%m.%d-%H:%M:%S)
+ FILE=pg-$DATE.sql.gz
+ echo creating backup file: $FILE
+ pg_dumpall | gzip > /backup/$FILE
9
+ sleep 1h
10
+done
0 commit comments