Update btrfs-backup script. Add lock file generation
This commit is contained in:
parent
f0f6e3c71a
commit
787578c355
1 changed files with 1 additions and 2 deletions
|
@ -53,8 +53,7 @@ create_lock() {
|
|||
fi
|
||||
|
||||
# Create new lock file with current PID
|
||||
sudo touch "$LOCK_FILE"
|
||||
sudo echo $$ > "$LOCK_FILE"
|
||||
sudo echo $$ | sudo tee "$LOCK_FILE"
|
||||
|
||||
# Ensure lock file is removed on script exit
|
||||
trap cleanup_lock EXIT
|
||||
|
|
Loading…
Reference in a new issue