#!/bin/bash if [ "${host}" = "ps.hpc.uio.no" ]; then LAPINSTANCE=development; elif [ "${host}" = "at.hpc.uio.no" ]; then LAPINSTANCE=production; elif [ "${host}" = "lap-test.hpc.uio.no" ]; then LAPINSTANCE=test; else LAPINSTANCE=local; fi if [ -f /projects/lap/${LAPINSTANCE}/trunk/tree/etc/library.bash ]; then . /projects/lap/${LAPINSTANCE}/trunk/tree/etc/library.bash fi # # determine the absolute path name of the ‘report’ directory # path=$(dirname $0) if [ "${path#./}" != "${path}" ]; then path="$(pwd)/${path#./}" fi if [ "${path#/}" = "${path}" ]; then if [ "${path}" = "." ]; then path="$(pwd)"; else path="$(pwd)/${path}" fi fi date=$(date "+%Y-%m-%d"); file=${path}/log/${date}.json; python ${path}/report.py --week --output ${file} > /dev/null 2>&1; svn add ${file}; summary=/tmp/.report.${USER}.$$; python ${path}/summary.py --out ${summary}; mailx -s "weekly LAP activity report" oe@ifi.uio.no < ${summary}