#!/bin/bash if [ -d /projects/nlpl ]; then host="abel"; root="/projects/nlpl"; elif [ -d /proj/nlpl ]; then host="taito"; root="/proj/nlpl"; elif [ -d /cluster/shared/nlpl ]; then host="saga"; root="/cluster/shared/nlpl"; fi if [ -z "${host}" ]; then echo "unable to locate NLPL project directory; exit." exit 1; fi start=$(date "+%y-%m-%d-%H:%M"); log="${root}/operation/log/${host}/data.vectors.puhti.${start}"; { echo -n "starting rsync(1) at "; date "+%y-%m-%d (%H:%M:%S)"; echo; rsync -rlptgHvvz --delete --chmod=g-w,o-w -e ssh ${root}/data/vectors/ oe@puhti.csc.fi:/projappl/nlpl/data/vectors/; echo; echo -n "completed rsync(1) at "; date "+%y-%m-%d (%H:%M:%S)"; } > ${log} 2>&1 if [ $(grep -v " is uptodate" ${log} | wc -l) -gt 11 -o $(date "+%u") -eq 1 ]; then grep -v " is uptodate" ${log} | mailx -r oe@ifi.uio.no -s "cron(8): data/vectors update to puhti" infrastructure@nlpl.eu andreku@ifi.uio.no; fi