mercurial/files/mercurial-s3-backup.sh
changeset 2 2556522a2a45
parent 0 df042396074e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/files/mercurial-s3-backup.sh	Sun Feb 09 12:05:37 2020 -0600
@@ -0,0 +1,10 @@
+#!/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/"