mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -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.
|
||||
|
||||
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 #
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue