Class: S3snapshot::TestLoader
- Inherits:
-
Thor
- Object
- Thor
- S3snapshot::TestLoader
- Defined in:
- lib/s3snapshot/test_loader.rb
Instance Method Summary collapse
-
#gendata ⇒ Object
Uploads the directory to the s3 bucket with a prefix.
Instance Method Details
#gendata ⇒ Object
Uploads the directory to the s3 bucket with a prefix
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/s3snapshot/test_loader.rb', line 25 def gendata directory = [:directory] puts "You are uploading directory #{directory}" hours = [:hours] backups = [:numbackups] # subtract off the number of hours * number of backups and convert the hours to seconds to set the start time time = Time.now.utc - hours * backups * 3600 for i in (1.. backups) TimeFactory.set_time (time) s3upload = DirUpload.new([:awsid], [:awskey], [:bucket], [:prefix], directory ) s3upload.upload time += hours * 3600 end end |