Class: ClearFile
Instance Method Summary
collapse
Methods inherited from DeployKit
#backup, #backup_path, #check_conf, #create_dirs, #ensure_directory_exists, #initialize, #timestamp
Constructor Details
This class inherits a constructor from DeployKit
Instance Method Details
#clear(path, days) ⇒ Object
14
15
16
17
18
|
# File 'lib/deploy_kit/clear_file.rb', line 14
def clear(path, days)
full_cmd = cmd % [path || final_filename, days || get_clear_days]
puts full_cmd if @verbose
`#{full_cmd}`
end
|
#cmd ⇒ Object
10
11
12
|
# File 'lib/deploy_kit/clear_file.rb', line 10
def cmd
"find %s -type f -mtime +%s -exec rm {} \\;"
end
|
#final_filename ⇒ Object
2
3
4
|
# File 'lib/deploy_kit/clear_file.rb', line 2
def final_filename
File.join(backup_path, "*.gz")
end
|
#get_clear_days ⇒ Object
6
7
8
|
# File 'lib/deploy_kit/clear_file.rb', line 6
def get_clear_days
@fu_conf[:default_clear_days].to_i
end
|