|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
how do i put a date on the log file name in crontab
i've tried
a = test-'date +%m%d%y'.log /path/file > /path/$a and when this job is ran... i get test-'date +%m%d%y'.log as the filename instead of the actual date... any clues? edit : n/m found it... `date +\%Y\%m\%d`.log and i cant use a variable for this or else it will print the exact string. |
|
#2
|
|||
|
|||
|
It would be helpful if you would tell us which shell you are using. With bash, ksh and tcsh you can use a variable as long as you make sure to use the proper "apostrophe"-character.
example bash/ksh: Code:
a=mylog-`date +%d%m%y`.log command > $a example tcsh: Code:
set a=mylog-`date +%d%m%y`.log command > $a -Steven |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > how do i put a date on the log file name in crontab |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|