Sha256: 2f6698b38aa46eea9f073e094a1cc34d17a679f2f41e439671769e5f0bc9d4ae

Contents?: true

Size: 1.39 KB

Versions: 19

Compression:

Stored size: 1.39 KB

Contents

#!/usr/bin/ruby

#    This file is part of EC2 on Rails.
#    http://rubyforge.org/projects/ec2onrails/
#
#    Copyright 2007 Paul Dowman, http://pauldowman.com/
#
#    EC2 on Rails is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    EC2 on Rails is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

# This script archives a file to S3

require "rubygems"
require "optiflag"
require "#{File.dirname(__FILE__)}/../lib/s3_helper"
require "#{File.dirname(__FILE__)}/../lib/utils"

include FileUtils

module CommandLineArgs extend OptiFlagSet
  optional_flag "bucket"
  optional_flag "dir"
  optional_flag "file"
  and_process!
end

# include the hostname in the bucket name so test instances don't accidentally clobber real backups
bucket = ARGV.flags.bucket
dir = ARGV.flags.dir
file = ARGV.flags.file
exit unless File.exists?(file)

@s3 = Ec2onrails::S3Helper.new(bucket, dir)
@s3.store_file(file)

Version data entries

19 entries across 19 versions & 11 rubygems

Version Path
Agiley-ec2onrails-0.9.10 server/files/usr/local/ec2onrails/bin/archive_file.rb
ScholarNexus-ec2onrails-0.9.10 server/files/usr/local/ec2onrails/bin/archive_file.rb
ScholarNexus-ec2onrails-0.9.11 server/files/usr/local/ec2onrails/bin/archive_file.rb
arpitjain11-ec2onrails-0.9.10 server/files/usr/local/ec2onrails/bin/archive_file.rb
ewoutvonk-ec2onrails-0.9.10.4.001 server/files/usr/local/ec2onrails/bin/archive_file
gigpark-ec2onrails-0.9.10.3 server/files/usr/local/ec2onrails/bin/archive_file
hennk-ec2onrails-0.9.9.1 server/files/usr/local/ec2onrails/bin/archive_file.rb
hennk-hennk-ec2onrails-0.9.9.2 server/files/usr/local/ec2onrails/bin/archive_file.rb
hennk-hennk-ec2onrails-0.9.9.3 server/files/usr/local/ec2onrails/bin/archive_file.rb
mdh-ec2onrails-0.9.10 server/files/usr/local/ec2onrails/bin/archive_file.rb
pauldowman-ec2onrails-0.9.10.0 server/files/usr/local/ec2onrails/bin/archive_file
pauldowman-ec2onrails-0.9.10.1 server/files/usr/local/ec2onrails/bin/archive_file
pauldowman-ec2onrails-0.9.10.2 server/files/usr/local/ec2onrails/bin/archive_file
pauldowman-ec2onrails-0.9.10.3 server/files/usr/local/ec2onrails/bin/archive_file
pauldowman-ec2onrails-0.9.10.4 server/files/usr/local/ec2onrails/bin/archive_file
pauldowman-ec2onrails-0.9.10 server/files/usr/local/ec2onrails/bin/archive_file.rb
rsanheim-ec2onrails-0.9.11.1 server/files/usr/local/ec2onrails/bin/archive_file.rb
skippy-ec2onrails-0.9.10 server/files/usr/local/ec2onrails/bin/archive_file.rb
skippy-ec2onrails-0.9.11 server/files/usr/local/ec2onrails/bin/archive_file.rb