
#!/bin/sh
# File	: lnx_cx-info_copy.sh
# By	: Maarten.deBoer@Atos.net, 240829
# Subject	: Script to copy (rsync) data from /CX-info to NFS-"share"
PGM=`basename $0|cut -d\. -f1`
VER="0.1"
LOG="${HOME}/log/${PGM}.log"

RSYNC="/usr/bin/rsync"

SRC_DIR="/CX-info"
DST_DIR="/mnt/cx-info"

echo "`date` ${PGM} v${VER} started."|tee -a ${LOG}
if [ ! -d ${SRC_DIR} ]; then
  echo "  SRC_DIR(${SRC_DIR}) NOT found. Exiting ..."
  exit 4
fi
if [ ! -d ${DST_DIR} ]; then
  echo "  DST_DIR(${DST_DIR}) NOT found. Exiting ..."
  exit 5
fi

sudo ${RSYNC} -rlzuv ${SRC_DIR} ${DST_DIR}|tee -a ${LOG}


echo "`date` ${PGM} v${VER} finished."|tee -a ${LOG}
exit 0

