Last active
March 25, 2022 16:56
-
-
Save sebnyberg/07410d1ca8195992d62298b28e0d3817 to your computer and use it in GitHub Desktop.
Make sure to use errexit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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