equal
deleted
inserted
replaced
1 #!/bin/bash |
1 #!/bin/bash |
2 |
2 |
3 BUCKET=$1 |
3 BACKUP_WORLD_NAME=$1 |
4 BACKUP_DIR=$2 |
4 BACKUP_DIR=$2 |
5 BACKUP_TAR="/tmp/$BUCKET.tgz" |
5 BUCKET=$3 |
|
6 BACKUP_TAR_DIR=$4 |
|
7 BACKUP_TAR="${BACKUP_TAR_DIR}/${BUCKET}.tgz" |
6 |
8 |
7 tar -zc -f $BACKUP_TAR $BACKUP_DIR |
9 tar -zc -f $BACKUP_TAR -C $BACKUP_DIR $BACKUP_WORLD_NAME {$BACKUP_WORLD_NAME}_nether ${BACKUP_WORLD_NAME}_the_end |
8 aws s3 mb "s3://$BUCKET/" |
10 aws s3 mb "s3://$BUCKET/" |
9 aws s3api put-bucket-versioning --bucket "$BUCKET" --versioning-configuration Status=Enabled |
11 aws s3api put-bucket-versioning --bucket "$BUCKET" --versioning-configuration Status=Enabled |
10 aws s3api put-bucket-lifecycle-configuration --bucket "$BUCKET" --lifecycle-configuration "file:///usr/local/share/minecraft-s3-backup-lifecycle.json" |
12 aws s3api put-bucket-lifecycle-configuration --bucket "$BUCKET" --lifecycle-configuration "file:///usr/local/share/minecraft-s3-backup-lifecycle.json" |
11 aws s3 cp $BACKUP_TAR "s3://$BUCKET/" |
13 aws s3 cp $BACKUP_TAR "s3://$BUCKET/" |
12 |
14 |