Diffrent output in cron jobs


 
Thread Tools Search this Thread
Operating Systems Solaris Diffrent output in cron jobs
# 1  
Old 10-04-2011
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
# 2  
Old 10-04-2011
Can you post the script that is behind these 2 files
This User Gave Thanks to h@foorsa.biz For This Post:
# 3  
Old 10-05-2011
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

Code:
 
[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"}


Last edited by pludi; 10-05-2011 at 04:09 AM..
# 4  
Old 10-05-2011
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.
This User Gave Thanks to vivek.goel.piet For This Post:
# 5  
Old 10-05-2011
But just give me examples
so i can do it..
# 6  
Old 10-05-2011
jkmistry:

In your crontab do the following:

Code:
* * * * * 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 ...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep behaves diffrent upon printf or echo output

Hello I want to check whether certain arguments were passed to the script, and when those are, not doing a log entry. If those arguments are not passed, always do a log entry (*new call*). What currently i have is this: echo "${@}"|grep -q \\- || \ tui-log -e "$LOG" "\r---- New call $$... (4 Replies)
Discussion started by: sea
4 Replies

2. Shell Programming and Scripting

Cron Jobs

How to see which cron jobs are not running? (2 Replies)
Discussion started by: rahul.raj1989
2 Replies

3. Solaris

Cron jobs and at jobs

There are two jobs in Solaris , Cron and at jobs.. I know how to disable or enable cron jobs. How can I enable at jobs and disable it. Kindly help. Rj (2 Replies)
Discussion started by: jegaraman
2 Replies

4. Shell Programming and Scripting

Cron jobs redirecting output

Hi guys with regards to Cron jobs if for example i run a script and it produces output to the admin mail how could i stop it from doing that at script level and redirrect it to a file so that admin does not have all these emails about jobs done correctly. (4 Replies)
Discussion started by: musicmancanora
4 Replies

5. HP-UX

Cron jobs

i am new for cronjobs can someone please tell me what logic is behind these RED Numbers and stars below? --> crontab -l 00 1 * * * /home/scripts/TarprodContent > /tmp/MprodBkup.log 2>&1 00 1 * * * /home/scripts/TarTprodContent > /tmp/TprodBkup.log 2>&1 00 1 * * *... (5 Replies)
Discussion started by: ajadaun
5 Replies

6. Solaris

Cron Jobs

whats up, Have some questions about cron jobs, I am fairly new to the unix os. My cronjob sends all output to my mail, does anyone know how to redirect output to come out on the screen??? Thanks...... (6 Replies)
Discussion started by: lewisoco
6 Replies

7. UNIX for Dummies Questions & Answers

Cron Jobs

Where can someone find info on Cron Jobs? Very new to UNIX and the PC I inherited looks to have several of them. Looks like they are some kind of background program that runs automatically at specified times. Would like to delete some of them and know more about them. (6 Replies)
Discussion started by: dereckbc
6 Replies

8. UNIX for Dummies Questions & Answers

cron jobs

I was wondering if itīs possible to cron job not to run on a certian day and time. Iīve got a job that runs everyday at 08:00 but would like it not to run on the 20:th between 08:00 and 10:00 Anyone know if this is possible, and if. How do i do it? regards... dOzY (3 Replies)
Discussion started by: dozy
3 Replies

9. Shell Programming and Scripting

cron jobs

hi folks, I need an explanation on cron jobs with an example (4 Replies)
Discussion started by: vijaysabari
4 Replies

10. UNIX for Dummies Questions & Answers

CRON Jobs

Hi, I am a total newbie to all things Unix. I've worked out I need to set up something that will allow me to automatically backup a DB for me, the DB is for a foum system I run. Now, I've only found out I need to use telnet for this, and worked out hwo to log into telnet today. From here... (4 Replies)
Discussion started by: eludlow
4 Replies
Login or Register to Ask a Question