1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-26 21:18:36 -06:00

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 # 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 # Setup location for home and backup directory
HMDIR="/home/sintan" HMDIR="/home/sintan"
BKDIR="/mnt/storage/sintan" BKDIR="/mnt/storage/sintan"