Summary - Sol 8 Crontab question

From: rmck <rmckeever_at_earthlink.net>
Date: Tue May 11 2004 - 10:51:47 EDT
Thanks..... 
It was the escape....

Casper:
"You need to escape the % because cron reads it as a line feed and gives the
rest of the line as input to the script.
Like so:
cp -p /opt/logs/perllog /opt/logs/perllog.`date +\%m-\%d-\%
"

Rob

-----Forwarded Message-----
From: rmck <rmckeever@earthlink.net>
Sent: May 11, 2004 7:27 AM
To: sunmanagers@sunmanagers.org
Subject: Sol 8 Crontab question

Hi 

I have a cron job that I just want to rename a file with a date at the end:

01 * * * *  cp -p /opt/logs/perllog /opt/logs/perllog.`date +%m-%d-%y' ; rm -rf /opt/logs/perllog ; touch /opt/logs/perllog

The cron runs but names the file like so:
perllog.

What am I doing wrong? It works on my Red Hat system......

Rob
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Tue May 11 10:51:41 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:32 EST