-- Basic UNIX script command
http://freeengineer.org/learnUNIXin10minutes.html
--list Crontab file
crontab -l
--edit crontab file
crontab -e
--Get yesterday using UNIX script
today=`date "+%Y%m%d"`
#get yesterday
date "+%Y%m%d"
date +%Y%m%d -d "yesterday"
CurrentDate=`TZ="GMT+24" date +'%y%m%d'`
echo $CurrentDate;
YESTERDAY=$((`date +%d` -1))
MONTH=`date +%m`
YEAR=`date +%Y`
NDAY=`date +%u`
WEEKDAY=${DAYS[`date +%u`]}
if [ $YESTERDAY -eq "0" ]
then
MONTH=$((MONTH-1))
if [ $MONTH -eq "0" ]
then
MONTH=12
YEAR=$((YEAR-1))
fi
set `cal $MONTH $YEAR`
shift $(($# - 1))
YESTERDAY=$1
fi
echo $YEAR$MONTH$YESTERDAY;
varyesterday="$YEAR$MONTH$YESTERDAY"
#end yesterday
echo $varyesterday;
Tuesday, July 13, 2010
Subscribe to:
Post Comments (Atom)
5 comments:
I would like to exchange links with your site pbrathod.blogspot.com
Is this possible?
Yes! Finally something about quotes.
My web page :: WA
Wow, wonderful weblog layout! How lengthy have you ever been blogging for?
you made blogging glance easy. The entire glance of your site is fantastic, let alone the content material!
My homepage; guild wars 2 gold
Hi there to every one, because I am genuinely eager of reading
this blog's post to be updated regularly. It carries good material.
Feel free to surf to my web page ... Teen anal hole drilled
smokeless cigarettes, ecig forum, best electronic cigarette, smokeless cigarettes, electronic cigarette, e cigarette reviews
Post a Comment