diff options
author | Julian Pawlowski <julian.pawlowski@gmail.com> | 2013-02-26 18:40:06 +0100 |
---|---|---|
committer | Julian Pawlowski <julian.pawlowski@gmail.com> | 2013-02-26 18:40:06 +0100 |
commit | 9dd3fa175bb7fd18f81f8e32468a842babe63e7f (patch) | |
tree | f6d068400d9fc9bc3666ed97f772031acd5bcd0d | |
parent | f9fce457486aa6d00ec83f009b18b9817c32468a (diff) |
run tar commands via sudo
-rw-r--r-- | app/models/backup_job.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/backup_job.rb b/app/models/backup_job.rb index 96574a7..91345e5 100644 --- a/app/models/backup_job.rb +++ b/app/models/backup_job.rb @@ -32,7 +32,7 @@ class BackupJob < ActiveRecord::Base if tmp_backup_directory.blank? self.state = 'failed' else - system "cd #{backup_directory} && tar czf #{backup_name_prefix}#{File.basename(tmp_backup_directory)}.tar.gz #{File.basename(tmp_backup_directory)}" + system "cd #{backup_directory} && sudo /usr/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") |