diff --git a/Dockerfile b/Dockerfile index a5825ea..61bfa80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,6 @@ ADD watch /watch VOLUME /data -ENV DELETE_FLAG "--delete" +ENV S3_SYNC_FLAGS "--delete" ENTRYPOINT [ "./watch" ] CMD ["/data"] diff --git a/README.md b/README.md index 6091b8e..bc60d95 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ docker run -d --name my-data-container \ ``` ### 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 diff --git a/watch b/watch index 0827cde..33dee7a 100755 --- a/watch +++ b/watch @@ -61,7 +61,7 @@ function restore { function backup { 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 return 1 fi @@ -69,7 +69,7 @@ function backup { function final_backup { 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 sleep 1 done