Can't get BASH script to work, problem with variables

My web host only keeps the raw apache log for 1 day.  I'm trying to copy that file over and rename it with the date.  I'm running a BASH script from a cron job.  Here is the script that doesn't work

#!/bin/bash
DATEVAR= date --date=yesterday +%Y-%m-%d
cp /...logs/access_log.1 /.../logs_aggregate/
mv /.../logs_aggregate/access_log.1 /.../$DATEVAR

It copies the log file, but doesn't like the $DATEVAR, anything static works fine.  If I type 'echo $DATEVAR' it prints yesterdays date in the format I want it, '2006-04-19'

So in a nutshell, I want to copy the log file to a new location and rename it with the revious days date.

I just started with bash scripting, so I know I am overlooking something silly, but I've been working on this off and on for over a week.

Thanks,
AmaddeusAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
DATEVAR=`date --date=yesterday +%Y-%m-%d`
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AmaddeusAuthor Commented:
I see, the funny quote and no space after the =

Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux OS Dev

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.