]> gitweb.fluxo.info Git - borger.git/commitdiff
Fix: minor changes
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 9 May 2023 16:06:46 +0000 (13:06 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 9 May 2023 16:06:46 +0000 (13:06 -0300)
borger

diff --git a/borger b/borger
index 53274d104db3d7945690c330ec2e7f9e4012bb90..7e35c3890bd432b8131996acd5dd3e94d38a3275 100755 (executable)
--- a/borger
+++ b/borger
@@ -30,6 +30,7 @@ OPTION="$2"
 BASE_CONFIG="$HOME/.config/borger"
 CONFIG="$BASE_CONFIG/$DESTINATION"
 INTERVAL="2h"
+TMP="${TMP:-/tmp}"
 
 # Print info
 function info {
@@ -198,6 +199,7 @@ function borger_prune {
 function borger_set_lockfile {
   if [ ! -z "$LOCKFILE" ]; then
     mkdir -p `dirname $LOCKFILE`
+
     if ( set -o noclobber; echo "$$" > "$LOCKFILE" ) &> /dev/null; then
       trap 'borger_unset_lockfile' INT TERM EXIT
     else
@@ -220,6 +222,7 @@ function borger_check_lockfile {
   if [ ! -z "$LOCKFILE" ] && [ -f "$LOCKFILE" ]; then
     pid="`cat $LOCKFILE`"
     process="`ps --no-headers -o comm $pid`"
+
     if [ "$?" == "0" ] && [ "`ps --no-headers -o comm $$`" == "$process" ]; then
       fatal "Another program is running for $LOCKFILE, skipping run"
     else