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..."