Class: ServerBackups::WebsiteBackup

Inherits:
BackupBase show all
Defined in:
lib/server_backups/website_backup.rb

Constant Summary collapse

SNAPSHOT_PATH =
Pathname('~/.var.www.backup.tar.snapshot.bin').expand_path

Constants inherited from BackupBase

BackupBase::BACKUP_TYPES, BackupBase::TIMESTAMP_FORMAT

Instance Attribute Summary

Attributes inherited from BackupBase

#backup_type, #config, #logger, #s3, #working_directory

Instance Method Summary collapse

Methods inherited from BackupBase

#backup_path, #backup_s3_key, daily, #do_backup, incremental, #incremental?, #initialize, #load_resources, monthly, #remove_old_backups, #s3_prefix, #store_backup, #take_backup, #timestamp, #title, weekly

Constructor Details

This class inherits a constructor from ServerBackups::BackupBase

Instance Method Details

#backup_filenameObject



9
10
11
# File 'lib/server_backups/website_backup.rb', line 9

def backup_filename
    "#{self.class.name.demodulize.underscore}.#{backup_type}.#{timestamp}.tgz"
end

#create_archive_commandObject



13
14
15
16
17
18
19
20
# File 'lib/server_backups/website_backup.rb', line 13

def create_archive_command
    <<-CMD
        tar --create -C '#{config.web_root}' --listed-incremental=#{SNAPSHOT_PATH} --gzip \
        --no-check-device \
        #{'--level=0' unless incremental?} \
        --file=#{backup_path} #{config.web_root}
    CMD
end

#restore(time) ⇒ Object



7
# File 'lib/server_backups/website_backup.rb', line 7

def restore(time); end