From cd3d33b8f20f63825fef4653df0be9e82abd1c45 Mon Sep 17 00:00:00 2001 From: Caila Finn Date: Mon, 23 Sep 2024 13:29:28 +0100 Subject: [PATCH] Fix syntax error in script RE #99 --- .../ansible/roles/mirror/tasks/update-external-data.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Linux/external-data-mirror/ansible/roles/mirror/tasks/update-external-data.sh b/Linux/external-data-mirror/ansible/roles/mirror/tasks/update-external-data.sh index d241137..555baef 100644 --- a/Linux/external-data-mirror/ansible/roles/mirror/tasks/update-external-data.sh +++ b/Linux/external-data-mirror/ansible/roles/mirror/tasks/update-external-data.sh @@ -1,10 +1,13 @@ -#! /bin/sh +#! /bin/bash SERVER_IP=${1} RSYNC_PROCESS_IDS=$(pidof rsync) -if [[ -z $RSYNC_PROCESS_IDS ]]; then +printf "%(%H:%M:%S)T " + +if [ -z "${RSYNC_PROCESS_IDS}" ]; then + echo "running rsync..." rsync -az --perms -o -g $SERVER_IP:/srv/$SERVER_IP/ftp/external-data/MD5/ /external-data/MD5/ else echo "rsync is already running. Skipping this time..."