Summary - Sol 8 Crontab question

From: rmck (rmckeever@earthlink.net)
Date: Tue May 11 2004 - 10:51:19 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



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:28:38 EDT