Skip to content

Instantly share code, notes, and snippets.

View hughe's full-sized avatar

Hugh Emberson hughe

View GitHub Profile
@hughe
hughe / powershell-backup.ps1
Created December 17, 2015 20:19
Example of backing up a folder to StorReduce using Powershell and the AWS CLI.
# # # #
# Simple PowerShell script to backup a timestamped directory to StorReduce
# # # #
# 1. Download and install aws-cli from https://aws.amazon.com/cli/
# 2. Create a bucket in StorReduce as well as access keys (and optionally bucket policy, if not using root account)
# 3. Open and/or create %UserProfile%\.aws\credentials (e.g. C:\Users\Administrator\.aws\credentials) and enter your keys from step 2:
#
# [default]
# aws_access_key_id=IAMANACCESSKEY
# aws_secret_access_key=IAMASECRETACCESSKEY
#!/usr/bin/env bash
set -o errexit -o pipefail -o nounset
ROOT="root"
if [[ -f "$ROOT.key" || -f "$ROOT.crt" ]]; then
echo "Root certificate already exist"
exit 1
fi

Keybase proof

I hereby claim:

  • I am hughe on github.
  • I am hughe (https://keybase.io/hughe) on keybase.
  • I have a public key whose fingerprint is B351 16C8 8A8E E1CE D24E B5BB 8F86 2D78 3EBE 4D8A

To claim this, I am signing this object: