summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Cozic <laurent22@users.noreply.github.com>2018-02-12 12:38:49 +0100
committerGitHub <noreply@github.com>2018-02-12 12:38:49 +0100
commit5aac62cfc0e9498469b73a9f8ad77320ed8fc9ea (patch)
tree33ed1d0616eceb8715d0458399fff3e74e1a319a
parentc313e0a322a6a0b8fc233bf7e272ab0230c35d1b (diff)
parentbfa1fd092e8df1937bbeb911ab92b4f853578637 (diff)
Merge pull request #109 from NathanFrench/master
Fix to assure only one instance is running.
-rwxr-xr-xrsync_tmbackup.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/rsync_tmbackup.sh b/rsync_tmbackup.sh
index 3d705cc..8df5969 100755
--- a/rsync_tmbackup.sh
+++ b/rsync_tmbackup.sh
@@ -103,7 +103,7 @@ fn_parse_ssh() {
}
fn_run_cmd() {
- if [ -n "$SSH_DEST_FOLDER_PREFIX" ]
+ if [ -n "$SSH_DEST_FOLDER_PREFIX" ]
then
eval "$SSH_CMD '$1'"
else
@@ -305,9 +305,9 @@ if [ -n "$(fn_find "$INPROGRESS_FILE")" ]; then
fn_log_error "Previous backup task is still active - aborting (command: $RUNNINGCMD)."
exit 1
fi
- else
+ else
RUNNINGPID="$(fn_run_cmd "cat $INPROGRESS_FILE")"
- if [ "$RUNNINGPID" = "$(pgrep "$APPNAME")" ]; then
+ if [ "$RUNNINGPID" = "$(pgrep -o -f "$APPNAME")" ]; then
fn_log_error "Previous backup task is still active - aborting."
exit 1
fi