Skip to content

Commit bb12e2d

Browse files
committed
🎉 initial commit
0 parents commit bb12e2d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
while true
4+
do
5+
DATE=$(date +%y.%m.%d-%H:%M:%S)
6+
FILE=pg-$DATE.sql.gz
7+
echo creating backup file: $FILE
8+
pg_dumpall | gzip > /backup/$FILE
9+
sleep 1h
10+
done

0 commit comments

Comments
 (0)