2013年8月27日星期二

AIX, how the timing of tasks, dynamic file output to go

I want to perform daily half past five p.m. / soft/start001.sh and the log output to / soft/start001_ date . Log file to

If today's date is 20130808
30 17 *** sh / soft/start001.sh> / soft/log/start001_20130808.log
If today's date is 20130809
30 17 *** sh / soft/start001.sh> / soft/log/start001_20130809.log

I used the following shell
30 17 *** sh / soft/start001.sh> / soft/log/start001_ `date +% Y% m% d`. log

However, the generated log file name is : start001_Fri Aug 9 23:49:50 BEIST 2013
did not reach , I want results

But I perform echo `date +% Y% m% d` return is 20,130,808

Why timed scheduling , to die.

seeking reasons .
------ Solution ---------------------------------------- ----
% needs to be escaped
Try the following shell


30 17 *** sh / soft/start001.sh> / soft/log/start001_ `date + \% Y \% m \% d` . log


没有评论:

发表评论