Update log file with date line with bash

I have a simple Mercurial update script that runs to pull the latest build to update a site. Right now I have it set to log itself but I cant get it to append its next entry at the end of the file with a date. I have some things I tried but they are not working how I would like it to.

update.sh

#!/usr/bin/env bash
source /home3/nwrepai1/public_html/wonunder5/config.sh

echo "$TIMESTAMP Updated" >> $LOGFILE

hg pull -u -b default >> $$LOGFILE

config.sh

#!/usr/bin/env bash
LOGFILE="/home3/nwrepai1/public_html/wonunder5/update_log.txt"
TIMESTAMP=`date "+%Y-%m-%d %H:%M:%S"`

Answers


Look at the LOGFILE variable in the 'hg' line - two dollar signs. Remove one.


Need Your Help


About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.