Skip to content

Instantly share code, notes, and snippets.

@glasnt glasnt/pastie
Created Sep 10, 2013

What would you like to do?
Given sufficient s3cmd setup, this script can be used to paste stuff into your bucket.
#! /bin/bash -e
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
You can’t perform that action at this time.