forked from mohamnag/docker-s3-dir-backup
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
15 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,25 @@ | ||
FROM mohamnag/aws-cli | ||
MAINTAINER Luca Mattivi <luca@smartdomotik.com> | ||
FROM amazon/aws-cli:2.15.35 | ||
LABEL Author="Luca Mattivi <luca@smartdomotik.com>" | ||
|
||
# change these to fit your need | ||
RUN apt-get update -q && apt-get install cron --yes | ||
|
||
# m h dom mon dow | ||
ENV BACKUP_CRON_SCHEDULE="* * * * *" | ||
RUN yum update -y && yum install tar gzip -y | ||
|
||
ENV BACKUP_TGT_DIR=/backup/ | ||
ENV BACKUP_SRC_DIR=/data/ | ||
ENV BACKUP_FILE_NAME='host_volumes' | ||
ENV BACKUP_FILE_NAME='backup' | ||
|
||
# bucket/path/to/place/ | ||
ENV BACKUP_S3_BUCKET= | ||
ENV AWS_DEFAULT_REGION= | ||
ENV AWS_ACCESS_KEY_ID= | ||
ENV AWS_SECRET_ACCESS_KEY= | ||
|
||
ADD crontab /etc/cron.d/backup-cron | ||
ADD backup.sh /opt/backup.sh | ||
ADD restore.sh /opt/restore.sh | ||
ADD cron.sh /opt/cron.sh | ||
|
||
RUN chmod 0644 /etc/cron.d/backup-cron | ||
# Create the log file to be able to run tail | ||
RUN touch /var/log/cron.log | ||
RUN chmod +x /opt/*.sh | ||
|
||
VOLUME $BACKUP_TGT_DIR | ||
VOLUME $BACKUP_SRC_DIR | ||
|
||
WORKDIR /opt/ | ||
|
||
CMD /opt/cron.sh | ||
ENTRYPOINT ["/opt/backup.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters