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
|
# Lock file creation with cleanup
|
||||||
cleanup_lock() {
|
cleanup_lock() {
|
||||||
rm -f "$LOCK_FILE"
|
sudo rm -f "$LOCK_FILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
create_lock() {
|
create_lock() {
|
||||||
|
@ -48,7 +48,7 @@ create_lock() {
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
# Lock file exists but process is not running, remove stale lock
|
# Lock file exists but process is not running, remove stale lock
|
||||||
rm -f "$LOCK_FILE"
|
cleanup_lock
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue