Skip to content

Instantly share code, notes, and snippets.

@wchristian
Created March 18, 2011 21:51
Show Gist options
  • Save wchristian/876911 to your computer and use it in GitHub Desktop.
Save wchristian/876911 to your computer and use it in GitHub Desktop.
#!/bin/sh
# change to home dir
cd $HOME
# erzeuge log file name basierend auf Datum, Zeit und Prozess ID
log=log/t5-download-lf10-`date '+%y%m%dT%H%M'`.$$.log
exec 0<&-
exec 1> $log
exec 2>&1
echo "(begin `date`)"
lock=$HOME/t5-download-lf10.lock
if lockfile -r 1 $lock; then
# -e= stop after non-zero return, -x=show cmd before execute
# set -ex
set -x
if make -f makefile5 download-lf10
then echo "t5-download-lf10 success"
else
errorTime=`date '+%F %T'`
mutt -s "t5-download-lf10 failure time: ${errorTime}" [email protected]
mutt -s "t5-dwonload-lf10 failure time: ${errorTime}" [email protected]
fi
rm -f $lock
fi
echo "(end `date`)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment