1752860 Members
3641 Online
108790 Solutions
New Discussion юеВ

Re: problem with crontab

 
Karthik_sg
Frequent Advisor

problem with crontab

hi all,y is tht expect script doesnt run with crontab.
hereris is how i run it.
sllpg.sh-->which calls g1.sh-->which calls-->r1.exp-->sendingmail.pl

my r1.exp has the code of the remote machine and ssh in this script.so i placed a crontab as
* * * * * /sllpg.sh y is tht expect script doesnt run thru this.

pls explain wht has to be done and whts wrong.Thnks in advance
6 REPLIES 6
larstr
Advisor

Re: problem with crontab

Has your file /sllpg.sh executable permissions?

try adding >>/tmp/expectlog.txt


You really want this script to execute every minute?

Lars
Rob Leadbeater
Honored Contributor

Re: problem with crontab

More than likely there are some variables missing from cron's environment. PATH is a usual one to get missed.

Check all of the called scripts and make sure that the full path to all executables is used.

If it doesn't try posting your various scripts so we can help to debug...

Cheers,

Rob
Ivan Ferreira
Honored Contributor

Re: problem with crontab

Check the cron log and the mail for the user, error will reported there.

Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
skt_skt
Honored Contributor

Re: problem with crontab

first thing to suspect the path.(give full path).Then redirect the output to a log file >>log.txt.

Check the /var/log/cron too
Karthik_sg
Frequent Advisor

Re: problem with crontab

hi thanks,for all the comments.i have done all the following but still expect doesnt work
Should Expect rpm should be installed on both the machines??
Rob Leadbeater
Honored Contributor

Re: problem with crontab

Hi,

You're asking us to try and debug stuff without being able to see the code you've written... we're not psychic !

Have you checked the cron log files as suggested ? Do they tell you anything ?

A quick Google for expect threw up this page:

http://expect.nist.gov/FAQ.html#q26

is that relevant to you ?

Cheers,

Rob