Home » Infrastructure » Unix » Crontab not running  () 1 Vote
Crontab not running [message #223022] Wed, 07 March 2007 04:04 Go to next message
prakashrao.k
Messages: 13
Registered: September 2006
Location: BANGALORE
Junior Member

I am trying to schedule a job in crontab -e but the entry is there

25 15 * * * echo "Hello world">>/opt/home/users/dse_dsa/frmt/xxx.txt

but it is not working and I have my user entry in cron.allow and cron.deny has follwoing entry

daemon
bin
smtp
nuucp
listen
nobody
noaccess

pl advise...

thnx in advance
Re: Crontab not running [message #223025 is a reply to message #223022] Wed, 07 March 2007 04:16 Go to previous messageGo to next message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
What is your UNIX flavour?

Once you entered in to your system just type

$mail

and paste the o/p?

Thanks,
Shahnaz.
Re: Crontab not running [message #223194 is a reply to message #223022] Wed, 07 March 2007 23:50 Go to previous messageGo to next message
prakashrao.k
Messages: 13
Registered: September 2006
Location: BANGALORE
Junior Member

cron tab is working now but issue is in the script which is am scheduling ...coz script have some thing like this,
msg="Hello World"
echo $msg>>$XLOG/a.txt

Actulay,

echo $XLOGS
/opt/user/log

crontab is not understanding this but when I give like this it is working

working code

echo $msg >> /opt/user/log/a.txt

pl correct me...i cant go and change all the code but there should be some work arround for this ...

thnx in advance
Prakash
Re: Crontab not running [message #247075 is a reply to message #223194] Sat, 23 June 2007 10:38 Go to previous messageGo to next message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
try like below in your script then run ur cron job

echo $msg>>${XLOG}/a.txt

thanks.
Re: Crontab not running [message #247077 is a reply to message #223022] Sat, 23 June 2007 11:00 Go to previous messageGo to next message
BlackSwan
Messages: 22911
Registered: January 2009
Senior Member
The blind leading the blind.

Th reality is that cron jobs do NOT go thru the same "logon process/sequence" that interactive session go through.
The typical .profile or .bash_profile files are NOT invoked implicitly by cron processes.
This can easily be demonstrated by adding the following command at the top of any cron script:
env | sort -o /tmp/myenv.out

After the cron job starts the do:
cat /tmp/myenv.out

to see which environmental variable exist & what their value is.

Any & all cron scripts MUST be responsible for ensuring the environmental variable are configured as needed by that script.

HTH & YMMV
Re: Crontab not running [message #247366 is a reply to message #247077] Mon, 25 June 2007 12:31 Go to previous messageGo to next message
andrew again
Messages: 2574
Registered: March 2000
Senior Member
25 15 * * * ~/cron_env; echo "Hello world">>/opt/home/users/dse_dsa/frmt/xxx.txt 2>&1
25 15 * * * /usr/bin/echo "Hello world">>/opt/home/users/dse_dsa/frmt/xxx.txt 2>&1

[Updated on: Mon, 25 June 2007 12:32]

Report message to a moderator

Re: Crontab not running [message #253816 is a reply to message #223194] Tue, 24 July 2007 23:19 Go to previous messageGo to next message
jawasev
Messages: 1
Registered: July 2007
Location: India
Junior Member
Hi,
Is this issue solved. Or may i try to help you.

Pls find something in Your Message:

msg="Hello World"
echo $msg>>$XLOG/a.txt

Actulay,

echo $XLOGS
/opt/user/log

Regards,
Jawahar.K

[Updated on: Tue, 24 July 2007 23:21]

Report message to a moderator

Re: Crontab not running [message #253828 is a reply to message #223022] Wed, 25 July 2007 00:38 Go to previous message
dilipece2001
Messages: 1
Registered: July 2007
Location: HYDERABAD
Junior Member

I suppose that this corntab is generally used for scheduling the jobs at UNIX level ...
Previous Topic: Unix
Next Topic: Installation
Goto Forum:
  


Current Time: Fri Oct 24 10:45:58 CDT 2014

Total time taken to generate the page: 0.12243 seconds