LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   scripts is not running thriugh cron ...manually running fine (https://www.linuxquestions.org/questions/linux-newbie-8/scripts-is-not-running-thriugh-cron-manually-running-fine-4175429225/)

ghoshdastidar1980 09-27-2012 01:24 AM

scripts is not running thriugh cron ...manually running fine
 
HI

when i am running this command manually it is working fine . but when i put it in cron there is no logfile generation under /date_export/res_logs/
from cron.log i can see that it is running in cron but files are not generating.....may be my date format is incorrect
....please help me

/usr/local/bin/dcli -l root -g /root/mycell "tail -n1000 /opt/oracle.oswatcher/osw/archive/...........l'|awk '{print $1,$2,$8}' |tee /date_export/res_logs/log.`date +%d%m.%T`

if i remove that date then it is generating

/usr/local/bin/dcli -l root -g /root/mycell "tail -n1000 /opt/oracle.oswatcher/osw/archive/...........l'|awk '{print $1,$2,$8}' |tee /date_export/res_logs/log

this is working fine ..

but i hv to add date time stamp in `date +%d%m.%T` format...

Regards,
Ani

druuna 09-27-2012 01:31 AM

This issue has come up multiple times, here's one thread: https://www.linuxquestions.org/quest...ab-4175427948/

In short: You need to escape the %, they are special when using cron.

ghoshdastidar1980 09-27-2012 02:17 AM

Thank you Druuna
 
HI Druuna,

Thanks a ton for your quick response. Please let me know if there is anyway to assign ponits, because i am new to this forum. i want to assign points to you. Tnx again.
Regards,
Ani

druuna 09-27-2012 02:42 AM

Quote:

Originally Posted by ghoshdastidar1980 (Post 4790423)
Thanks a ton for your quick response.

You're welcome.

Quote:

Please let me know if there is anyway to assign ponits, because i am new to this forum.
LQ has a helpful and a reputation system.

I see you already seem to have found the helpful button, here's a link explaining the reputation system: https://www.linuxquestions.org/quest...vb3_reputation


All times are GMT -5. The time now is 04:11 PM.