Class: S3snapshot::TestLoader

Inherits:
Thor
  • Object
show all
Defined in:
lib/s3snapshot/test_loader.rb

Instance Method Summary collapse

Instance Method Details

#gendataObject

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 = options[:directory]
  puts "You are uploading directory #{directory}"
  
  hours = options[:hours]
  backups = options[: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(options[:awsid], options[:awskey],  options[:bucket],   options[:prefix], directory )
    s3upload.upload
    
    
    
    time += hours * 3600
    
  end
  
  
end