summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJulian Pawlowski <julian.pawlowski@gmail.com>2013-03-25 17:09:59 +0100
committerJulian Pawlowski <julian.pawlowski@gmail.com>2013-03-25 17:09:59 +0100
commit15602d52b598caecbb1daabe621e1d2e02df6be7 (patch)
treeb0c24b1322799c5a7002bfb9f9f5579ab62acd0f /app
parentc203c3efaae924f420862ad8a243dc18d2c9e154 (diff)
add ionice for backup jobs
Diffstat (limited to 'app')
-rw-r--r--app/models/backup_job.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/backup_job.rb b/app/models/backup_job.rb
index 9cb4f53..e2f2e6c 100644
--- a/app/models/backup_job.rb
+++ b/app/models/backup_job.rb
@@ -37,7 +37,7 @@ class BackupJob < ActiveRecord::Base
if tmp_backup_directory.blank?
self.state = 'failed'
else
- system "cd #{backup_directory} && nice -n 19 sudo /bin/tar czf #{backup_name_prefix}#{File.basename(tmp_backup_directory)}.tar.gz #{File.basename(tmp_backup_directory)}"
+ system "cd #{backup_directory} && nice -n 19 ionice -c2 -n7 sudo /bin/tar czf #{backup_name_prefix}#{File.basename(tmp_backup_directory)}.tar.gz #{File.basename(tmp_backup_directory)}"
require 'fileutils'
FileUtils.rm_rf tmp_backup_directory
file = File::Stat.new("#{backup_directory}/#{backup_name_prefix}#{File.basename(tmp_backup_directory)}.tar.gz")