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?
piratesAsked:
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
0
 
ozoCommented:
try giving the full path to the date command
0
 
piratesAuthor Commented:
I tried adding the full path to the date command, but it did not
solve the problem.
0
 
piratesAuthor Commented:
Thanks,  that solved the problem.
0
All Courses

From novice to tech pro — start learning today.