diff options
| author | Luke Hoersten <[email protected]> | 2020-02-09 11:58:21 -0600 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2020-02-09 11:58:21 -0600 |
| commit | 785a8b2b45f0faf5e2578099bca1090c9c1417bb (patch) | |
| tree | 53b4737ab07baf112c4bbc5b968ba146ec64bf7a /roles/mercurial/files/mercurial-s3-backup.sh | |
Opensourcing raspberry pi roles.
Diffstat (limited to 'roles/mercurial/files/mercurial-s3-backup.sh')
| -rw-r--r-- | roles/mercurial/files/mercurial-s3-backup.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/roles/mercurial/files/mercurial-s3-backup.sh b/roles/mercurial/files/mercurial-s3-backup.sh new file mode 100644 index 0000000..b5ba305 --- /dev/null +++ b/roles/mercurial/files/mercurial-s3-backup.sh @@ -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/" |
