Make sure only one instance is running using flock

This commit is contained in:
Sayantan Santra 2022-07-31 19:03:32 -05:00
parent 648531c3cd
commit 6465b5e9a6

View file

@ -2,6 +2,9 @@
# This script backs up some important stuff
# Run only one instance of this script at one time
[ "${BKLOCKER}" != "running" ] && exec env BKLOCKER="running" flock -en "/tmp/impfilesbk" "$0" "$@" || :
# Setup location for home and backup directory
HMDIR="/home/sintan"
BKDIR="/mnt/storage/sintan"