Update btrfs-backup script. Add lock file generation
This commit is contained in:
parent
787578c355
commit
7934ea89ee
1 changed files with 2 additions and 2 deletions
|
@ -37,7 +37,7 @@ LOCK_FILE="/var/run/btrfs-backup-${1}.lock"
|
|||
|
||||
# Lock file creation with cleanup
|
||||
cleanup_lock() {
|
||||
rm -f "$LOCK_FILE"
|
||||
sudo rm -f "$LOCK_FILE"
|
||||
}
|
||||
|
||||
create_lock() {
|
||||
|
@ -48,7 +48,7 @@ create_lock() {
|
|||
exit 1
|
||||
else
|
||||
# Lock file exists but process is not running, remove stale lock
|
||||
rm -f "$LOCK_FILE"
|
||||
cleanup_lock
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue