Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

####### Bash Loging Function
function logOutput()
{
logMessage=$1
logTime=`date`
logFile=/var/log/program.log
echo “$logMessage Completed $logTime” >> $logFile
}

# Bash Lockfile
LOCKFILE=”/var/script/program.lock”

if [ -e “${LOCKFILE}” ]; then
echo “Already running.”
exit 99

else

echo $! > “${LOCKFILE}”
chmod 644 “${LOCKFILE}”

###################### Do Whatever you want ##########################
ls -al /home # lol
logOutput ‘oh whatever completed.’

### Ok i dont need lock now.
### Release Lock
rm -f “${LOCKFILE}”

fi