#! /usr/bin/env bash # $Header: /home/ubuntu/mnt/e9_copy/mitgcm.org/scripts/build_mitgcm_front,v 1.6 2018/01/14 20:58:55 jmc Exp $ #-- create a daily log file (if not already there) cd $HOME/testing/logs logpfx="bld_front_" ; sfx=`date +%m%d` logfile="../logs/${logpfx}$sfx" if test -e $logfile ; then : else #-- clean-up old log files: n=$(( `ls ${logpfx}* 2>/dev/null | wc -l` - 10 )) if test $n -gt 0 ; then echo -n ' remove files: ' ls -lt ${logpfx}* | tail -"$n" ls -t ${logpfx}* | tail -"$n" | xargs rm -f fi echo ' create new log file:' $logfile touch $logfile fi echo '' >> $logfile date >> $logfile cat >> $logfile <> $logfile cd $HOME/testing/front_content && make install >> $logfile 2>&1 retval=$? if test "x$retval" != x0 ; then echo "'make install' return with ERROR $retval" fi