Created
September 10, 2013 04:43
-
-
Save glasnt/6505076 to your computer and use it in GitHub Desktop.
Given sufficient s3cmd setup, this script can be used to paste stuff into your bucket.
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
#! /bin/bash -e | |
BUCKET="mabucket" | |
PASTE="paste" | |
if [ $# -eq 0 ]; then echo "Usage: $0 filename, or -l for list"; exit 1;fi | |
if [ $1 = "-l" ]; then s3cmd ls s3://$BUCKET/$PASTE/; exit 0; fi | |
FILENAME=`date +"%s"` | |
cp $1 /tmp/$FILENAME.txt | |
s3cmd put -P /tmp/$FILENAME.txt s3://$BUCKET/$PASTE/$FILENAME >/dev/null 2>/dev/null | |
echo "File $1 pasted to http://$BUCKET/$PASTE/$FILENAME" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment