minecraft/aws-s3-backup/files/minecraft-s3-backup.sh
changeset 156 ebd8a21a0e62
parent 136 1751be33651f
child 158 1b7ccb729164
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/minecraft/aws-s3-backup/files/minecraft-s3-backup.sh	Sat Jul 03 13:23:46 2021 -0500
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+BUCKET=$1
+DATE=`date --iso-8601`
+BACKUP_DIR=$2
+BACKUP_TAR="/tmp/$BUCKET-$DATE.tgz"
+
+tar -zc -f $BACKUP_TAR $BACKUP_DIR
+aws s3 mb "s3://$BUCKET/"
+aws s3 cp $BACKUP_TAR "s3://$BUCKET/"
+
+rm $BACKUP_TAR