mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-22 06:14:19 -07:00
Preventing multiple execution of v-backup-users
This commit is contained in:
parent
f5cc2bb7f2
commit
d20f1aebd0
1 changed files with 8 additions and 0 deletions
|
@ -4,6 +4,14 @@
|
||||||
#
|
#
|
||||||
# The function backups all system users.
|
# The function backups all system users.
|
||||||
|
|
||||||
|
scriptname="v-backup-users"
|
||||||
|
pidof -x "$scriptname"
|
||||||
|
for pid in $(pidof -x "$scriptname"); do
|
||||||
|
if [ $pid != $$ ]; then
|
||||||
|
echo "[$(date)] : $scriptname : Process is already running with PID $pid"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
# Variable&Function #
|
# Variable&Function #
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue