Class: Lzop
- Inherits:
-
Rehabilitate::Plugin
- Object
- Rehabilitate::Plugin
- Lzop
- Defined in:
- lib/rehabilitate/plugins/lzop.rb
Instance Method Summary collapse
Methods inherited from Rehabilitate::Plugin
Instance Method Details
#compress(options) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/rehabilitate/plugins/lzop.rb', line 4 def compress() ._backup_files.collect! do |backup_file| new_backup_name = "#{backup_file}.tar.lzop" log "Compressing files..." log "cd #{.tmp} && tar --use-compress-program=lzop -cf #{new_backup_name} #{backup_file.split("/").last}" log %x[cd #{.tmp} && tar --use-compress-program=lzop -cf #{new_backup_name} #{backup_file.split("/").last}] ._tmp_files << new_backup_name new_backup_name end end |
#uncompress(options) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rehabilitate/plugins/lzop.rb', line 15 def uncompress() ._backup_files.collect! do |backup_file| new_backup_name = "#{.tmp}/#{File.basename(backup_file).gsub(".tar.lzop", "")}" log "Uncompressing files to #{.tmp}" log %{ cd #{.tmp} && lzop -dq < #{._backup_files.first} | tar -xvf - } log %x{ cd #{.tmp} && lzop -dq < #{._backup_files.first} | tar -xvf - } ._tmp_files << new_backup_name new_backup_name end end |