Sha256: 74694d8c64db9c34c77400449bacadc294f16ac625ea7c5ccc87095e98d05052

Contents?: true

Size: 488 Bytes

Versions: 27

Compression:

Stored size: 488 Bytes

Contents

Standup.script :node do
  def run
    exec "s3cmd mb #{bucket}"
    
    update_cron '@hourly', <<-CMD, :section => name
      #{scripts.webapp.db.dump_command scripts.webapp.db_name} | gzip > dump.gz
      s3cmd put dump.gz #{path_prefix}/`date -u +%Y-%m-%d/%H-%M-%S`.gz
      rm dump.gz
    CMD
  end
  
  protected
  
  def bucket
    "s3://#{Standup::Settings.webapp.name}-#{node.name}-standup-backup"
  end
  
  def path_prefix
    "#{bucket}/db/#{scripts.webapp.db_name}"
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
standup-0.6.4 scripts/db_backup.rb
standup-0.6.3 scripts/db_backup.rb
standup-0.6.2 scripts/db_backup.rb
standup-0.6.1 scripts/db_backup.rb
standup-0.6.0 scripts/db_backup.rb
standup-0.5.14 scripts/db_backup.rb
standup-0.5.13 scripts/db_backup.rb
standup-0.5.11 scripts/db_backup.rb
standup-0.5.10 scripts/db_backup.rb
standup-0.5.9 scripts/db_backup.rb
standup-0.5.8 scripts/db_backup.rb
standup-0.5.7 scripts/db_backup.rb
standup-0.5.6 scripts/db_backup.rb
standup-0.5.5 scripts/db_backup.rb
standup-0.5.4 scripts/db_backup.rb
standup-0.5.1 scripts/db_backup.rb
standup-0.5.0 scripts/db_backup.rb
standup-0.4.0 scripts/db_backup.rb
standup-0.3.37 scripts/db_backup.rb
standup-0.3.36 scripts/db_backup.rb