Skip to content

Instantly share code, notes, and snippets.

@riywo
Created October 27, 2012 05:01
Show Gist options
  • Save riywo/3963011 to your computer and use it in GitHub Desktop.
Save riywo/3963011 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use Amazon::S3;
my $s3 = Amazon::S3->new({
aws_access_key_id => $ENV{S3_KEY},
aws_secret_access_key => $ENV{S3_SECRET},
retry => 1,
});
my $bucket = $s3->bucket($ARGV[0]);
my $filepath = $ARGV[1];
my $keyname = $ARGV[2];
$bucket->add_key_filename($keyname, $filepath) or die $s3->err . ':' . $s3->errstr;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment