Merge pull request #14 from jmahowald/master
allow us to not delete files
This commit is contained in:
commit
082e5188aa
|
@ -6,5 +6,6 @@ ADD watch /watch
|
||||||
|
|
||||||
VOLUME /data
|
VOLUME /data
|
||||||
|
|
||||||
|
ENV S3_SYNC_FLAGS "--delete"
|
||||||
ENTRYPOINT [ "./watch" ]
|
ENTRYPOINT [ "./watch" ]
|
||||||
CMD ["/data"]
|
CMD ["/data"]
|
||||||
|
|
|
@ -80,6 +80,9 @@ docker run -d --name my-data-container \
|
||||||
elementar/s3-volume --force-restore /data s3://mybucket/someprefix
|
elementar/s3-volume --force-restore /data s3://mybucket/someprefix
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 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 S3_SYNC_FLAGS=":
|
||||||
|
|
||||||
### Using Compose and named volumes
|
### Using Compose and named volumes
|
||||||
|
|
||||||
Most of the time, you will use this image to sync data for another container.
|
Most of the time, you will use this image to sync data for another container.
|
||||||
|
|
4
watch
4
watch
|
@ -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; 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; 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
|
||||||
|
|
Loading…
Reference in New Issue