Update btrfs-backup script. Add lock file generation

This commit is contained in:
albert 2024-12-19 05:14:39 +01:00
parent f0f6e3c71a
commit 787578c355
Signed by: albert
GPG key ID: 3895DD267CA11BA9

View file

@ -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