Skip to content

Commit

Permalink
Add overwrite and remove flags
Browse files Browse the repository at this point in the history
  • Loading branch information
martin31821 committed Oct 2, 2019
1 parent b625ed6 commit 7eb058b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion s3_to_s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ do
echo "Mirroring $SOURCE_BACKUP to $TARGET_BACKUP"
{ mc ls "$SOURCE_BACKUP" > /dev/null 2>&1 && echo '> Source bucket OK'; } || { echo '> Source bucket does not exist or no access' && failed_buckets+=($bucket) && continue; }
{ mc ls "$TARGET_BACKUP" > /dev/null 2>&1 && echo '> Target bucket exists'; } || { mc mb "$TARGET_BACKUP" && echo '> Target bucket created'; }
{ mc mirror -q "$SOURCE_BACKUP" "$TARGET_BACKUP" && echo '> Backup done'; } || { echo '> Backup failed, see logs above' && failed_buckets+=($bucket) && continue; }
{ mc mirror -q --overwrite --remove "$SOURCE_BACKUP" "$TARGET_BACKUP" && echo '> Backup done'; } || { echo '> Backup failed, see logs above' && failed_buckets+=($bucket) && continue; }
done

echo "Backup finished, ${#failed_buckets[@]} buckets failed."
Expand Down

0 comments on commit 7eb058b

Please sign in to comment.