Class: FilesBackup
Constant Summary
Constants inherited
from Backup
Backup::DATE_FORMAT
Instance Attribute Summary collapse
Attributes inherited from Backup
#dry_run, #quiet
Instance Method Summary
collapse
Methods inherited from Backup
#backup_type, #clean_files, #compress?, #debug?, #encrypt?, #encrypt_compress_pipe_command, #ensure_path, #filename, #filename_extension, #filepath, #get_datetime_from_filename, #human_filesize, #mark_file_to_delete, #minimum_backup_size, #output_command, #process_clean_files, #run, #show_statistics, #verify_backup
Constructor Details
#initialize(files_backup = '/etc', compress = true, encrypt = nil) ⇒ FilesBackup
Returns a new instance of FilesBackup.
6
7
8
9
|
# File 'lib/backup/files_backup.rb', line 6
def initialize files_backup = '/etc', compress = true, encrypt = nil
@files_backup = files_backup
super compress: compress, encrypt: encrypt
end
|
Instance Attribute Details
#files_backup ⇒ Object
Returns the value of attribute files_backup.
4
5
6
|
# File 'lib/backup/files_backup.rb', line 4
def files_backup
@files_backup
end
|
Instance Method Details
#backup_command ⇒ Object
23
24
25
|
# File 'lib/backup/files_backup.rb', line 23
def backup_command
"tar -c #{files_backup}"
end
|
#backup_type_filename ⇒ Object
15
16
17
|
# File 'lib/backup/files_backup.rb', line 15
def backup_type_filename
files_backup.sub(/^\//, '').gsub('/', '_')
end
|
#print_info ⇒ Object
11
12
13
|
# File 'lib/backup/files_backup.rb', line 11
def print_info
puts "Run #{files_backup} backup to #{filepath}..."
end
|