File tree Expand file tree Collapse file tree 5 files changed +27
-1
lines changed
Expand file tree Collapse file tree 5 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -15,5 +15,8 @@ RUN chmod +x /start.sh
1515ADD sync.sh /sync.sh
1616RUN chmod +x /sync.sh
1717
18+ ADD get.sh /get.sh
19+ RUN chmod +x /get.sh
20+
1821ENTRYPOINT ["/start.sh" ]
1922CMD ["" ]
Original file line number Diff line number Diff line change @@ -42,10 +42,21 @@ Run once then delete the container:
4242 -v /home/user/data:/data:ro \
4343 istepanov/backup-to-s3 no-cron
4444
45+ Run once to get from S3 then delete the container:
46+
47+ docker run --rm \
48+ -e ACCESS_KEY=myawskey \
49+ -e SECRET_KEY=myawssecret \
50+ -e S3_PATH=s3://my-bucket/backup/ \
51+ -v /home/user/data:/data:rw \
52+ istepanov/backup-to-s3 get
53+
4554Run once to delete from s3 then delete the container:
4655
4756 docker run --rm \
4857 -e ACCESS_KEY=myawskey \
4958 -e SECRET_KEY=myawssecret \
5059 -e S3_PATH=s3://my-bucket/backup/ \
5160 istepanov/backup-to-s3 delete
61+
62+ Security considerations: on restore, this opens up permissions on the restored files widely.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ echo " Job get started: $( date) "
6+
7+ umask 0
8+ /usr/local/bin/s3cmd get -r $PARAMS " $S3_PATH " " $DATA_PATH "
9+
10+ echo " Job get finished: $( date) "
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ log_target_prefix =
2424mime_type =
2525multipart_chunk_size_mb = 15
2626preserve_attrs = True
27- progress_meter = True
27+ progress_meter = False
2828proxy_host =
2929proxy_port = 0
3030recursive = False
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ echo "secret_key=$SECRET_KEY" >> /root/.s3cfg
1313
1414if [[ " $1 " == ' no-cron' ]]; then
1515 exec /sync.sh
16+ elif [[ " $1 " == ' get' ]]; then
17+ exec /get.sh
1618elif [[ " $1 " == ' delete' ]]; then
1719 exec /usr/local/bin/s3cmd del -r " $S3_PATH "
1820else
You can’t perform that action at this time.
0 commit comments