LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-27-2012, 02:24 AM   #1
ghoshdastidar1980
LQ Newbie
 
Registered: Mar 2010
Posts: 9

Rep: Reputation: 0
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
 
Old 09-27-2012, 02:31 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
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.
 
1 members found this post helpful.
Old 09-27-2012, 03:17 AM   #3
ghoshdastidar1980
LQ Newbie
 
Registered: Mar 2010
Posts: 9

Original Poster
Rep: Reputation: 0
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
 
Old 09-27-2012, 03:42 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by ghoshdastidar1980 View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
running scripts with cron suj Linux - Newbie 2 07-21-2010 05:56 PM
[SOLVED] script not running via crontab, run's fine manually astroboiii Linux - Software 10 02-08-2010 11:36 PM
Running shell scripts with cron Lossenelin Linux - General 2 09-24-2009 03:51 PM
Script not running properly in cron though runs well if run manually. linuxlover.chaitanya Linux - Newbie 4 01-15-2009 04:31 AM
Running Scripts at Boot, via Cron etc maxhugen Linux - Newbie 2 12-06-2005 10:42 PM


All times are GMT -5. The time now is 10:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration