roles/mercurial/files/mercurial-s3-backup.sh
author Luke Hoersten <luke@hoersten.org>
Sun, 09 Feb 2020 11:59:05 -0600
changeset 1 fd351734f007
parent 0 df042396074e
permissions -rw-r--r--
Prometheus and WriteFreely roles are work in progress.

#!/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/"