Skip to content

Commit

Permalink
Recover using rsync
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvandescheur committed Oct 18, 2016
1 parent 2b5f53f commit ee9cbbe
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
7 changes: 0 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,5 @@ RUN apt-get update && apt-get install -y \
# Add file tree
ADD files /

# Download backups
RUN tarsnap -x -f $(tarsnap --list-archives | egrep [0-9]{14}-[^-]+?-svenv.nl/media | sort -r | head -n 1) && \
tarsnap -x -f $(tarsnap --list-archives | egrep [0-9]{14}-[^-]+?-svenv.nl/database | sort -r | head -n 1)

# Set owner
RUN chown app:app -R /srv/

# Set volumes
VOLUME ["/etc/nginx/conf.d", "/etc/ssl/", "/root/", "/srv/", "/tmp/", "/usr/local/lib/python2.7/dist-packages", "/usr/lib/python2.7/dist-packages", "/usr/local/etc/", "/var/lib/postgresql/", "/var/run/postgresql/", "/var/log/", "/var/mail"]
34 changes: 34 additions & 0 deletions files/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

# Docker entrypoint script
# Executes original command

# Summary:
# --------
# * Set up script
# * Start services
# * Download latest backups
# * Fix permissions
# * Execute command

# Set up script
set -e
set -o pipefail


# Start services
service rsyslog start
service cron start
service postfix start


# Download latest backups
rsync -a svenv.nl@recovery.svenv.nl:~/recovery/ /


# Fix permissions
chown app:app -R /srv/


# Execute command
exec "$@"

0 comments on commit ee9cbbe

Please sign in to comment.