Skip to content
This repository was archived by the owner on May 4, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
env.txt
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM ubuntu:trusty
FROM alpine:latest
MAINTAINER Borja Burgos <borja@tutum.co>, Mia Iversen <mia@chillfox.com

RUN apt-get update && apt-get install -y python-pip && pip install awscli
RUN apk add --update-cache python py-pip ca-certificates tzdata &&\
pip install awscli &&\
rm -fR /etc/periodic &&\
rm -rf /var/cache/apk/*

ADD backup.sh /backup.sh
ADD restore.sh /restore.sh
Expand Down
4 changes: 2 additions & 2 deletions backup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/ash

# Get timestamp
: ${BACKUP_SUFFIX:=.$(date +"%Y-%m-%d-%H-%M-%S")}
Expand All @@ -9,7 +9,7 @@ tar czf $tarball $BACKUP_TAR_OPTION $PATHS_TO_BACKUP

# Create bucket, if it doesn't already exist
BUCKET_EXIST=$(aws s3 ls | grep $S3_BUCKET_NAME | wc -l)
if [ $BUCKET_EXIST -eq 0 ];
if [ $BUCKET_EXIST -eq 0 ];
then
aws s3 mb s3://$S3_BUCKET_NAME
fi
Expand Down
2 changes: 1 addition & 1 deletion restore.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/ash

# Find last backup file
: ${LAST_BACKUP:=$(aws s3 ls s3://$S3_BUCKET_NAME | awk -F " " '{print $4}' | grep ^$BACKUP_NAME | sort -r | head -n1)}
Expand Down
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/ash

if [[ "$RESTORE" == "true" ]]; then
./restore.sh
Expand Down