crontab file copy file and add date

I can telnet into my sever and issue the following command.

cp usr/local/etc/httpd/htdocs/register/cdata.txt usr/local/etc/httpd/htdocs/`date +'%m%d%y'`cdata

The file cdate.txt will be copied correctly adding the date to the file and leaving off the  extension.

When I put the same command in the cronfile, the file is copied
but does not have the date added to the name of the file.

How can  I solve this problem?
Who is Participating?
ozoConnect With a Mentor Commented:
What's in your crontab?
Can you try
* * * * * cp /usr/local/etc/httpd/htdocs/register/cdata.txt /usr/local/etc/httpd/htdocs/`date +\%m\%d\%y`cdata
try giving the full path to the date command
piratesAuthor Commented:
I tried adding the full path to the date command, but it did not
solve the problem.
piratesAuthor Commented:
Thanks,  that solved the problem.
All Courses

From novice to tech pro — start learning today.