diff options
author | lookshe <github@lookshe.org> | 2017-03-21 16:21:27 +0100 |
---|---|---|
committer | lookshe <github@lookshe.org> | 2017-03-21 16:21:27 +0100 |
commit | 424052977fd9696879c9467922c11383b455e96f (patch) | |
tree | aaa7d21089a3fa94401d7ea0ac0179e67f73ffd5 | |
parent | 1640a9584c09b4474e1ac9e1ad2e2854b7636cd7 (diff) |
run borg with lower priority
-rwxr-xr-x | backup.sh | 8 | ||||
-rwxr-xr-x | backup_db.sh | 6 |
2 files changed, 7 insertions, 7 deletions
@@ -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 |