projects
/
zfs-nexenta
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ff5bbb1
)
Added an already running check
master
author
Alan J. Pippin
<ajp@pippins.net>
Sat, 9 Oct 2010 14:31:02 +0000
(08:31 -0600)
committer
Alan J. Pippin
<ajp@pippins.net>
Sat, 9 Oct 2010 14:31:02 +0000
(08:31 -0600)
zfs-replicate-all
patch
|
blob
|
history
diff --git
a/zfs-replicate-all
b/zfs-replicate-all
index 8dc4a05baa8f2402419a0f876c21b0004e2fb136..6f105d673064f450780fd13305edc79b8ca5fb35 100755
(executable)
--- a/
zfs-replicate-all
+++ b/
zfs-replicate-all
@@
-15,6
+15,17
@@
mylogfile="$logdir/zfs-replicate-all.log"
date=`date`
starttime=`date +%s`
date=`date`
starttime=`date +%s`
+# Make sure we aren't already running
+SCRIPT_NAME=${0##*/}
+PROCESS_LIST=`tempfile`
+ps -ef | grep -e "$SCRIPT_NAME" | grep -v grep | grep -v $$ | grep -v $PPID >> $PROCESS_LIST
+if [[ $? == 0 ]]; then
+ echo "$date Another $SCRIPT_NAME process is already running" >> $mylogfile
+ cat $PROCESS_LIST >> $mylogfile
+ exit 1
+fi
+[[ -e "$PROCESS_LIST" ]] && rm -f $PROCESS_LIST
+
# This function checks to see if our runtime has exceeded our stoptime
timeexceeded() {
if [[ $maxruntime == 0 ]]; then
# This function checks to see if our runtime has exceeded our stoptime
timeexceeded() {
if [[ $maxruntime == 0 ]]; then