watch script now deletes remote files when they are deleted locally

This commit is contained in:
Fábio D. Batista 2015-07-25 23:32:05 -03:00
parent 248e54c202
commit 1a27402970
1 changed files with 3 additions and 3 deletions

6
watch
View File

@ -57,7 +57,7 @@ function restore {
function backup {
echo "backup $LOCAL => $REMOTE"
if ! aws s3 sync "$LOCAL" "$REMOTE"; then
if ! aws s3 sync "$LOCAL" "$REMOTE" --delete; then
echo "backup failed" 1>&2
return 1
fi
@ -65,8 +65,8 @@ function backup {
function final_backup {
echo "backup $LOCAL => $REMOTE"
while ! aws s3 sync "$LOCAL" "$REMOTE"; do
echo "backup failed" 1>&2
while ! aws s3 sync "$LOCAL" "$REMOTE" --delete; do
echo "backup failed, will retry" 1>&2
sleep 1
done
exit 0