executing script by cron doesnt give me expected result


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users executing script by cron doesnt give me expected result
# 1  
Old 09-12-2007
executing script by cron doesnt give me expected result

Hi frnds...

I m facing very irritating problem already waisted my 2 days..

I have a following script..( i am pasting only the main code)


ftp -ivn 213.194.40.77 <<FTP
user $user $password
binary
cd $FileDir/out
lcd $localpath
get $file
rename $FileDir/out/$file $FileDir/tmp/$file
bye

FTP

if [ -f "$localpath/$file" ]
then
gzip -dcf $localpath/$file > $localpath/$TELEXISTable.dat
else
ErrorMessage="E2E - uploaded $TELEXISTable file $file is empty"
echo "$ToolName : $ErrorMessage"
fi



now the problem is.. when i execute this manually i got the expected .dat file ..
but when its executed by cron I got the .dat file of zero KB.

pl tell me what cud be the reason....
pl help


anchal
# 2  
Old 09-12-2007
pls don't start multiple threads on the same subject - thread closed!

Last edited by vgersh99; 09-12-2007 at 09:20 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Script is not executing as expected when I schedule it in cron

Hi, I have a shell script which fetches the MRP status and the LAG status. When I execute it manually like, sh <script_name>, it fetches the output as expected, but when I schedule through crontab, it's not working as expected. Any help would be really appreciated. Here is the code... (3 Replies)
Discussion started by: Nagaraj R
3 Replies

2. Shell Programming and Scripting

Nohup not give expected output. Non-stop running process

Hello, I am trying to make a bash script, I tested nohup but it did not help me. My code is: ffmpeg -i $input_url -c:v copy -c:a copy -listen 1 -f mpegts http://localhost:port/live/test When I open it in VLC, it starts feeding my screen and I see bitrate values. When I stop watching it,... (4 Replies)
Discussion started by: baris35
4 Replies

3. Shell Programming and Scripting

Expect script not executing via cron

Hello All, I'm having an issue getting an expect script to run as a cron job. The script executes fin if I run it from the command line but I get nothing when trying to run it as a cron job. I've researched other forums and threads and there have been references to the environment, or lack... (16 Replies)
Discussion started by: KingT617
16 Replies

4. Shell Programming and Scripting

Script not executing using cron

Hi, I created a script which connects to database and update a table. This script is running fine when i run it manually but when i am trying to execute it scheduling in crontab.script is executing but Data is not getting updated. below is my script sqlplus test/##### >> test_feed.log <<!... (6 Replies)
Discussion started by: sv0081493
6 Replies

5. Shell Programming and Scripting

Binary Operator expected while executing the below shell script.

Hi Experts, Iam bit poor in shell scripting, Here my requirement is for generating an alert where the oracle database db_recovery_file_dest_size usage. If it reaches beyond 80% should recieve an alert through an email. Want to schedule this alert in cron. #!/bin/bash .... (9 Replies)
Discussion started by: Jagadish m
9 Replies

6. UNIX for Dummies Questions & Answers

Cron shell script not executing diskutil command

I'm trying to learn how to use cron for repetative tasks. I have an external disk that needs to be unmounted and remounted every hour due to some problems that a backup utility (specifically, TimeMachine) is having repeatedly accessing the device. I've created a shell script that will find the... (3 Replies)
Discussion started by: illuminate
3 Replies

7. Shell Programming and Scripting

Executing the result of a program as a shell script

I have a program that returns a shell script and I want to execute the script. I'll use cat in my simple example, but wget is an example that is feasible. $ # First setup a script $ echo "ls > df" > simple $ # "cat simple" is now a program that returns a script $ cat simple ls df $ ... (3 Replies)
Discussion started by: kopite
3 Replies

8. Shell Programming and Scripting

Problem with executing a shell script through the cron

Hi, I have a shell script as below: ORACLE_HOME=/usr/local/opt/oracle/product/dev export ORACLE_HOME PATH=$PATH:$ORACLE_HOME/bin:/usr/bin export PATH OUTFILE=/export/home/`basename $0`.out export OUTFILE export IDEN df -k . | tail -1 | read a b c d e f echo $a >> $OUTFILE echo $b... (4 Replies)
Discussion started by: Abhinav Pandey
4 Replies

9. Shell Programming and Scripting

Script doesn't work as expected when run on cron

The script checks for free space stats on Oracle. If there are any tablespaces with more than 85% usage it prints the details of the tablespace. If all the tablespaces have more than 15% free space, then "All tablespaces have more than 15 pct free space" must be printed on the screen. When I run... (2 Replies)
Discussion started by: RoshniMehta
2 Replies

10. HP-UX

executing shell script from the cron

This isn't the usual problem that a shell script runs from the command line and not the cron. It's a little different. Among other things, the shell scrip executes my .profile to set a bunch of variables. It then does an env to ensure that it ran OK. There are echos in the shell script and... (2 Replies)
Discussion started by: abNORMal
2 Replies
Login or Register to Ask a Question