Script behaving differently in Crontab..


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Script behaving differently in Crontab..
# 1  
Old 09-30-2004
Script behaving differently in Crontab..

I posted this in Shell scripting... maybe I'll try it in this forum..

*****************

I wrote a script to stop a process,truncate its log files and re-start the process...
We are using Progress Software in Unix ( Sun Sparc)

When ever I start this progress program , it should kick off a C pgm in the background..
The script work perfectly fine when I run it from command prompt..
When I scheduled it from crontab, the stopping and truncating log files works fine..
When it starts of the progress program, that time also it looks OK..
But when I do (ps -ef ) for that C program, I found two instances of the C program running.. One is the actual C program which I wanted it to run and other is the same C program with slightly different process name...
> ps -ef | grep 'myprocess'
admin1 .......... myprocess
admin1 .......... usr/bin/sh -C myprocess

Also, the second process is the parent for first process...
Any ideas why it is working differently in crontab ??
If my explanation is not clear, let me know... I could post some screen dumps which might explain more...

Thanks in advance,
************************
# 2  
Old 09-30-2004
We have some rules here. Please read them. Note in particular:

(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post where your goal is to get an answer more quickly.

(5) Search the forums database with your keywords before asking.


This question is the most commonly asked question about cron.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk script modification - treat certain files differently

awk 'BEGIN{OFS=","} FNR == 1 {if (NR > 1) {print fn,fnr,nl} fn=FILENAME; fnr = 1; nl = 0} {fnr = FNR} /UNUSUAL/ && /\.gz/ ~ /FILENAME/ {nl++} <'{system ("gunzip -cd FILENAME")}' END ... (2 Replies)
Discussion started by: SkySmart
2 Replies

2. Filesystems, Disks and Memory

Different partitions of a drive behaving differently in Windows

I have a memory card of my Nokia N73 attached to laptop. There are a few partitions. Why all partitions behave differently? As clear from the attachments, for some partition, delete option is disabled. See 'Disk 1' which is my memory card. Here, patition 'G' (CHECK), i created in windows. The... (6 Replies)
Discussion started by: ravisingh
6 Replies

3. Shell Programming and Scripting

Same KSH behaving differently on diff servers

HI all I have written a ksh to execute PL/sql procedure and generate the log file. The script is working fine to the extent of calling the taking input, executing PL/SQL procedure. On one server the log file is getting generated properly. i,e it shows the DBMS output . The log file size was... (9 Replies)
Discussion started by: ramakrishnakini
9 Replies

4. Shell Programming and Scripting

jobs command behaving differently in script

Here is my test script: #!/bin/sh result=`jobs` echo " Jobs: "$result result=`ls` echo " LS "$result Here is the output: Jobs: LS 0 1 2 3 4 5 6 7 gcd initialize.sh #inter_round_clean.sh# inter_round_clean.sh inter_round_clean.sh~ look parallel_first_run.sh... (3 Replies)
Discussion started by: nealh
3 Replies

5. Shell Programming and Scripting

Executing a script from CRON behaves differently than terminal

Hi have a script which transferers from Microsoft server to Linux box. The scripts(ksh) is on Linux box. If I run script from terminal, it transfers files to directory. Where as If I run script from CRON. It does not. Here is the log of both: Terminal execution log:... (2 Replies)
Discussion started by: dipeshvshah
2 Replies

6. Shell Programming and Scripting

sed and cut behaving differently

I have attached a file with few records. First 2 characters of each record are binary characters. I can remove it by and it works fine. But is behaving differently and removing more than expected characters. Can someone help me in accomplishing it through sed? Thanks in advance. (13 Replies)
Discussion started by: amicon007
13 Replies

7. UNIX for Advanced & Expert Users

Unix script rm behaiving differently in difference machine

Hi All The below is the script, if i supply the script with the argument -f then it will delete the tmp file . We are having 3 unix system out of that two system are processing this file only one system is not processing and the error showin is below the script .. can you please help me ... (2 Replies)
Discussion started by: arunkumar_mca
2 Replies

8. Shell Programming and Scripting

Why is a variable behaving differently in ksh script.

Guys i have strange behaviour with command output being saved in a variable instead of a tmp file. 1. I suck command output into a variable Sample command output # cleanstats DRIVE INFO: ---------- Drv Type Mount Time Frequency Last Cleaned Comment *** ****... (1 Reply)
Discussion started by: lavascript
1 Replies

9. UNIX for Advanced & Expert Users

Script behaving differently on two servers

All, I have a script that runs on 2 servers and there seems to be something wrong. It's producing different results on the 2 servers. Here is the script on server1 which is behaving correctly but on 2 behaving differently. 2nd server: I couldn't make out whats the error is?... (5 Replies)
Discussion started by: mhssatya
5 Replies

10. Shell Programming and Scripting

Script behaving differently in Crontab..

Hi, I wrote a script to stop a process,truncate its log files and re-start the process... We are using Progress Software in Unix ( Sun Sparc) When ever I start this progress program , it should kick off a C pgm in the background.. The script work perfectly fine when I run it from command... (4 Replies)
Discussion started by: newtoxinu
4 Replies
Login or Register to Ask a Question