Diffrent output in cron jobs

Hi,

I have issue with cron.
When i run script manually output is fine but when i add it to cron output file is not as same.

both file attach some junk charecter comming in cron output.
thanx
Jignesh

Can you post the script that is behind these 2 files

1 Like

Hi,

find the attach scripts.
My observation is when i run this script manually my terminal size row=42, column=124, but when cron run same script terminal size creating issue.
And due to same long ping command will creating output issue.
In Cron script is running fine but i didn't get desired output

thanx/regards
Jignesh

 
[whttodo] code
#!/usr/local/bin/expect --
set ipadd [lindex $argv 0]
set dst "ping routing-instance XYXW_GSM_SIGNALING 10.235.100.149 rapid count 25 \r"
set timeout -1
 
eval spawn telnet $ipadd
expect "*:"; send "xxxxxxxx\r"
expect "*d:" ; send "xxxxxx\r"
expect "*>" ; send $dst\r
expect "*>" {send "quit\r"}

Try to set the environment values in the script code.
I faced this issue and it was resolved by just setting the environment variables in the script.

1 Like

But just give me examples
so i can do it..

jkmistry:

In your crontab do the following:

* * * * * env > /var/tmp/env_cron

Once the file gets populated (a minute or so) erase the line and compare the output with the "env" of the working user. Maybe the TERM type needs to be set, most likely the PATH as well etc ...