Created
December 31, 2015 21:25
-
-
Save phildier/f8e2ab3d1427a9c6a4cd to your computer and use it in GitHub Desktop.
pipe tar output to an s3 file
This file contains hidden or 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
| #!/bin/bash | |
| # tar up a file or directory and copy it to an s3 object without any temporary files | |
| # usage: | |
| # $ tar-to-s3.sh <source file or dir> <destination s3 path> | |
| # example: | |
| # $ tar-to-s3.sh . s3://mybucket/archive.tar | |
| src=$1 | |
| dst=$2 | |
| tar -c "$src" | aws s3 cp - "$dst" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment