From 424052977fd9696879c9467922c11383b455e96f Mon Sep 17 00:00:00 2001 From: lookshe Date: Tue, 21 Mar 2017 16:21:27 +0100 Subject: run borg with lower priority --- backup.sh | 8 ++++---- backup_db.sh | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backup.sh b/backup.sh index 5f50674..6daeac7 100755 --- a/backup.sh +++ b/backup.sh @@ -71,11 +71,11 @@ function check_borg_repo { repo_path="$userserver:$backupdir/$serverdir/$repo" fi #check if repo exists - $borg_local_path list --remote-path "$borg_remote_path" --no-files-cache "$repo_path" > /dev/null 2>&1 + $nice $borg_local_path list --remote-path "$borg_remote_path" --no-files-cache "$repo_path" > /dev/null 2>&1 if [ $? -ne 0 ] then # create repo if not exists - $borg_local_path init --remote-path "$borg_remote_path" --encryption "$borg_encryption" "$repo_path" + $nice $borg_local_path init --remote-path "$borg_remote_path" --encryption "$borg_encryption" "$repo_path" fi } @@ -97,10 +97,10 @@ function backup_dir { ret=0 if [ -f "backup.ignore" ] then - $borg_local_path create --remote-path "$borg_remote_path" --one-file-system --exclude-from "backup.ignore" --compression "$borg_compression" "$repo_path" . + $nice $borg_local_path create --remote-path "$borg_remote_path" --one-file-system --exclude-from "backup.ignore" --compression "$borg_compression" "$repo_path" . ret=$? else - $borg_local_path create --remote-path "$borg_remote_path" --one-file-system --compression "$borg_compression" "$repo_path" . + $nice $borg_local_path create --remote-path "$borg_remote_path" --one-file-system --compression "$borg_compression" "$repo_path" . ret=$? fi popd > /dev/null diff --git a/backup_db.sh b/backup_db.sh index 4143539..90b9b72 100755 --- a/backup_db.sh +++ b/backup_db.sh @@ -74,11 +74,11 @@ function check_borg_repo { repo_path="$userserver:$backupdir/$serverdir/$repo" fi #check if repo exists - $borg_local_path list --remote-path "$borg_remote_path" --no-files-cache "$repo_path" > /dev/null 2>&1 + $nice $borg_local_path list --remote-path "$borg_remote_path" --no-files-cache "$repo_path" > /dev/null 2>&1 if [ $? -ne 0 ] then # create repo if not exists - $borg_local_path init --remote-path "$borg_remote_path" --encryption "$borg_encryption" "$repo_path" + $nice $borg_local_path init --remote-path "$borg_remote_path" --encryption "$borg_encryption" "$repo_path" fi } @@ -96,7 +96,7 @@ function backup_db { repo_path="$userserver:$backupdir/$serverdir/$repo::{now:$default_timestamp}" fi ret=0 - $borg_local_path create --remote-path "$borg_remote_path" --one-file-system --compression "$borg_compression" "$repo_path" . + $nice $borg_local_path create --remote-path "$borg_remote_path" --one-file-system --compression "$borg_compression" "$repo_path" . ret=$? if [ $ret -ne 0 ] then -- cgit v1.2.3