Skip to content

Instantly share code, notes, and snippets.

@jakubigla
Last active January 3, 2017 14:43
Show Gist options
  • Save jakubigla/b7e75e719e165034fd609cc9e594329e to your computer and use it in GitHub Desktop.
Save jakubigla/b7e75e719e165034fd609cc9e594329e to your computer and use it in GitHub Desktop.
Tar directories and upload to AWS Glacier
#!/usr/bin/env bash
DIRS=$(ls -d *);
for DIRR in $DIRS; do
echo $DIRR
tar -zcvf "$DIRR.tar.gz" "$DIRR"
aws glacier upload-archive --account-id - --vault-name Hangar --body "$DIRR.tar.gz" --region eu-central-1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment