Sha256: cd861c753c85ee4693b0470a70e1aa5c0205dc7b2d56a41488c83f45557b4374

Contents?: true

Size: 1.26 KB

Versions: 3

Compression:

Stored size: 1.26 KB

Contents

# encoding: utf-8

###


Model.new(:app_files_backup, 'App files') do

  archive :files do |archive|
    dir_app = $app_config[:path]


    #archive.add "/path/to/a/file.rb"
    archive.add "#{dir_app}"

    in_dirs = ($backup_config['backup']['app_files']['include'] rescue [])  || []

    ignore_dirs = %w[.idea .git .vagrant .ansible .chef backup]
    ex_dirs_base = %w[tmp log public/assets public/images public/uploads ]
    ex_dirs = ($backup_config['backup']['app_files']['exclude'] rescue []) || []

    (in_dirs).each do |d|
      archive.add "#{dir_app}#{d}"
    end

    (ex_dirs_base+ignore_dirs+ex_dirs).each do |d|
      archive.exclude "#{dir_app}#{d}"
    end



  end





  #### Storages


  $backup_config['storages'].each do |b|
    if b['type']=='scp'
      store_with SCP do |server|
        build_storage_scp(server, b)
      end

    elsif b['type']=='s3'
      ##
      # Store on Amazon S3
      #
      store_with S3 do |s3|
        build_storage_s3(s3, b)
      end

    elsif b['type']=='local'
      ##
      # Local (Copy)
      #
      store_with Local do |local|
        build_storage_local(local, b)
      end
    end
  end



  ##
  # Gzip [Compressor]
  #
  compress_with Gzip



  ### notify

  notify_by Mail do |mail|
    c = $smtp_config


  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
optimacms_backups-0.0.4 lib/optimacms_backups/backup/models/app_files_backup.rb
optimacms_backups-0.0.3 lib/optimacms_backups/backup/models/app_files_backup.rb
optimacms_backups-0.0.2 lib/optimacms_backups/backup/models/app_files_backup.rb