Skip to content

Instantly share code, notes, and snippets.

@sebnyberg
Last active March 25, 2022 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebnyberg/07410d1ca8195992d62298b28e0d3817 to your computer and use it in GitHub Desktop.
Save sebnyberg/07410d1ca8195992d62298b28e0d3817 to your computer and use it in GitHub Desktop.
Make sure to use errexit
#!/usr/bin/env bash
#
# Archive a folder by uploading it to S3 and
# renive it locally
#
# Usage:
#
# ./s3archive.sh $dir $bucket
#
echo "Uploading to archive bucket..."
aws s3 cp $1 "s3://${2}/${1}"
echo "Removing local files..."
rm -rf $1
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment