Apply suggestions from code review

Co-authored-by: Mirsal <mirsal@mirsal.fr>
This commit is contained in:
Fábio D. Batista 2020-12-02 16:40:07 -03:00 committed by GitHub
parent 05dfe25557
commit 014b843a2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -6,6 +6,6 @@ ADD watch /watch
VOLUME /data VOLUME /data
ENV DELETE_FLAG "--delete" ENV S3_SYNC_FLAGS "--delete"
ENTRYPOINT [ "./watch" ] ENTRYPOINT [ "./watch" ]
CMD ["/data"] CMD ["/data"]

View File

@ -81,7 +81,7 @@ docker run -d --name my-data-container \
``` ```
### Deletion and sync ### Deletion and sync
By default if there are files that are deleted in your local file system, those will be deleted remotely. If you wish to turn this off set the environment variable DELETE_FLAGS=": By default if there are files that are deleted in your local file system, those will be deleted remotely. If you wish to turn this off set the environment variable S3_SYNC_FLAGS=":
### Using Compose and named volumes ### Using Compose and named volumes

4
watch
View File

@ -61,7 +61,7 @@ function restore {
function backup { function backup {
echo "backup $LOCAL => $REMOTE" echo "backup $LOCAL => $REMOTE"
if ! $AWS s3 sync "$LOCAL" "$REMOTE" $DELETE_FLAG; then if ! $AWS s3 sync "$LOCAL" "$REMOTE" $S3_SYNC_FLAGS; then
echo "backup failed" 1>&2 echo "backup failed" 1>&2
return 1 return 1
fi fi
@ -69,7 +69,7 @@ function backup {
function final_backup { function final_backup {
echo "backup $LOCAL => $REMOTE" echo "backup $LOCAL => $REMOTE"
while ! $AWS s3 sync "$LOCAL" "$REMOTE" $DELETE_FLAG; do while ! $AWS s3 sync "$LOCAL" "$REMOTE" $S3_SYNC_FLAGS; do
echo "backup failed, will retry" 1>&2 echo "backup failed, will retry" 1>&2
sleep 1 sleep 1
done done