summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruglygus <gary@gary.local>2015-04-04 07:50:11 -0400
committeruglygus <gary@gary.local>2015-04-04 07:50:11 -0400
commit2f64db5973b5f1b13221d391076967b5a55dbb7a (patch)
treeeec8088720710d9081306ecf2594a64ad9e17ac9
parenta728820bfd9d715bf45678ee2b36bd9aaba53ebb (diff)
PID reuse
Checks for PID and $APPNAME in the results from pgrep in order to avoid the problem where the PID from a previous run has been recycled by another process. This caused us to exit even though we are not currently running.
-rwxr-xr-xrsync_tmbackup.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/rsync_tmbackup.sh b/rsync_tmbackup.sh
index 553dcd6..0105ee1 100755
--- a/rsync_tmbackup.sh
+++ b/rsync_tmbackup.sh
@@ -113,7 +113,7 @@ fi
# -----------------------------------------------------------------------------
if [ -f "$INPROGRESS_FILE" ]; then
- if pgrep -F "$INPROGRESS_FILE" > /dev/null 2>&1 ; then
+ if pgrep -F "$INPROGRESS_FILE" "$APPNAME"> /dev/null 2>&1 ; then
fn_log_error "Previous backup task is still active - aborting."
exit 1
fi