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
15
15
ADD sync.sh /sync.sh
16
16
RUN chmod +x /sync.sh
17
17
18
+ ADD get.sh /get.sh
19
+ RUN chmod +x /get.sh
20
+
18
21
ENTRYPOINT ["/start.sh" ]
19
22
CMD ["" ]
Original file line number Diff line number Diff line change @@ -42,10 +42,21 @@ Run once then delete the container:
42
42
-v /home/user/data:/data:ro \
43
43
istepanov/backup-to-s3 no-cron
44
44
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
+
45
54
Run once to delete from s3 then delete the container:
46
55
47
56
docker run --rm \
48
57
-e ACCESS_KEY=myawskey \
49
58
-e SECRET_KEY=myawssecret \
50
59
-e S3_PATH=s3://my-bucket/backup/ \
51
60
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 =
24
24
mime_type =
25
25
multipart_chunk_size_mb = 15
26
26
preserve_attrs = True
27
- progress_meter = True
27
+ progress_meter = False
28
28
proxy_host =
29
29
proxy_port = 0
30
30
recursive = False
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ echo "secret_key=$SECRET_KEY" >> /root/.s3cfg
13
13
14
14
if [[ " $1 " == ' no-cron' ]]; then
15
15
exec /sync.sh
16
+ elif [[ " $1 " == ' get' ]]; then
17
+ exec /get.sh
16
18
elif [[ " $1 " == ' delete' ]]; then
17
19
exec /usr/local/bin/s3cmd del -r " $S3_PATH "
18
20
else
You can’t perform that action at this time.
0 commit comments