From 8f488bbab2bfa3fc735fd60d3bf6806693269111 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Wed, 17 Apr 2013 12:47:12 +0100 Subject: [PATCH] Build script: include TZ in timestamps, remove duplication --- scripts/build | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/build b/scripts/build index ff615e58..d9dc16b9 100755 --- a/scripts/build +++ b/scripts/build @@ -1,10 +1,13 @@ #!/bin/bash +function timestamp { + date "+%Y%m%d %H:%M %Z" +} + function melpa { + timestamp - date "+%Y%m%d %H:%M" - - date "+%Y%m%d %H:%M" > $HOME/www/status.txt + timestamp > $HOME/www/status.txt echo "building..." >> $HOME/www/status.txt MELPADIR=${MELPADIR:-$HOME/melpa} @@ -41,13 +44,13 @@ function melpa { /usr/sbin/logrotate -s $HOME/log/logrotate.state $HOME/log/melpa.logrotate 1>> ${STDOUT} 2>> ${STDERR} EMAIL=`mktemp` - echo "Subject: Melpa status `date '+%Y-%m-%d %H:%M:%S'`" > ${EMAIL} + echo "Subject: Melpa status `timestamp`" > ${EMAIL} cat ${MELPASTDOUT} ${STDOUT} ${ENVLOG} ${STDERR} >> ${EMAIL} /usr/sbin/sendmail dcurtis@milkbox.net < ${EMAIL} cat ${ENVLOG} ${STDERR} ${STDOUT} | tee $WEBROOT/lastrun.txt - date "+%Y%m%d %H:%M" > $HOME/www/status.txt + timestamp > $HOME/www/status.txt echo "completed" >> $HOME/www/status.txt }