summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJulian Pawlowski <julian.pawlowski@gmail.com>2013-03-23 04:21:48 +0100
committerJulian Pawlowski <julian.pawlowski@gmail.com>2013-03-23 04:21:48 +0100
commita9b2c7f508bfdf6d67389e39036d038b3c77f547 (patch)
treedc5575549dab5047004bc6679ef3790cffe9c9e7 /app
parentc60844ed7d0cbc2c1fa417e41d0c7be90adf68cd (diff)
"nice -n 19" for backup related background tasks
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 48dd27e..9cb4f53 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} && 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 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")