ftp script scheduled in autosys


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users ftp script scheduled in autosys
# 1  
Old 11-02-2008
ftp script scheduled in autosys

I am trying to schedule FTP script through autosys.The scripts works perfectly fine in unix environment.All the run time parameters are evaluated in the profile.Both are unix servers.
But the strange thing is that the script is not getting executed through autosys and it returns success and autosys completes successfuly.
Here the source file is FTMYERS.ACE.WKLY.PAID.G0092V00 and target file is
ACEFW92V00
Any solution to this ??

This is my script

#!/usr/bin/ksh
MACH_IP=$1
REMOTE_DIR=$2
LOCAL_DIRECTORY=$3
mode=$4
direction=$5
REMOTE_FILE=$6
LOCAL_FILE=$7

ftp -v -n $MACH_IP << cmd >> ftplog
user xyz pwd
cd $REMOTE_DIR
lcd $LOCAL_DIRECTORY
$mode
$direction $REMOTE_FILE $LOCAL_FILE
quit
cmd

here REMOTE_FILE=FTMYERS.ACE.WKLY.PAID.G0092V00
and LOCAL_FILE=ACEFW92V00


_____________________

command: ksh /data1/FTP_CBSI.KSH $MACH_IP $REMOTE_DIR $LOCAL_DIRECTORY $mode $direction $REMOTE_FILE $LOCAL_FILE

This is the log of FTP

Connected to 3.230.11.15 (3.182.54.18).
220-Authorized uses only. All activity may be monitored and reported.
220-
220 bashoi12 FTP server ready.
331 Password required for frhuj.
230 User frhuj logged in.
250 CWD command successful.
Local directory now /data/dkikiio
200 Type set to I.
(remote-file) (local-file)
221-You have transferred 0 bytes in 0 files.
221-Total traffic for this session was 348 bytes in 0 transfers.
221-Thank you for using the FTP service on bashoi12 .
221 Goodbye.

I think this happens due to the period(.) inside the file name
# 2  
Old 11-02-2008
one more thing i forgot to mention the varibales REMOTE_FILE and LOCAL_FILE are being evaluated from database.
AP_CBSI_TGT_file=`sqlplus -s DB name/pwd@DB<< EOF
set heading off
select feed_name || 'FW' || Fiscal_week local_name from pocube.t_ap_cbsi_load_control where ftp_status is null and rownum = 1;
EOF`
export AP_CBSI_TGT_file
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Script when scheduled in Crontab gives extra records in output

Hi, We have created a script that's checks the latency of IIDR subscription by fetching details from a config file (that contains subscription details) and running the CHCCLP command. The out put is then concatenated in a csv file. Once all subscription details are saved the script send a mail... (7 Replies)
Discussion started by: ab095
7 Replies

2. UNIX for Beginners Questions & Answers

Script gives error when scheduled in crontab

i have written one script which is working fine when i run it manually but giving error when i schedule it in crontab. cat SUMMARY.sh #!/bin/bash DT1=`date +%Y%m%d` echo "Off PP TT" >>summary_$DT1.txt cat ues1.txt_$DT1 >>summary_$DT1.txt cat ues2.txt_$DT1... (2 Replies)
Discussion started by: scriptor
2 Replies

3. Red Hat

Script not working if crontab scheduled

Hi all, I'm working to a script with /bin/bash shebang. The script works perfectly if I run from command line. The script runs under a non root user and inside the commands are set with sudo command in a such a way they can be run under root, for example (first rows of the script):... (5 Replies)
Discussion started by: idro
5 Replies

4. Shell Programming and Scripting

run unix script as scheduled job

Hi, I want my unix script to run as a scheduled job such that the script is invoked once every 15 minutes. Is there any way to achieve this other than running the script as a cron job? (2 Replies)
Discussion started by: vignesh53
2 Replies

5. Shell Programming and Scripting

variable has no value if run the script automatically/scheduled

Hi All, I am using ksh as the shell. I have a script that should store variable after executing "onstat" on informix. I can execute it successfully without any issue if run manually, however the value is not showing up when run automatically(scheduled). Is there anything needed to make the... (1 Reply)
Discussion started by: tungaw2004
1 Replies

6. Shell Programming and Scripting

A running Script giving error while scheduled in cronjob

Hi, I have script which is properly running but when i schedule it in cron it throws an error like : Your "cron" job on retrprdapp1 /usr/bin/sh /retr/cron/ftp.sh 2>&1 produced the following output: /retr/cron/ftp.sh: syntax error at line 17: `(' unexpected line17 is # Get list of... (10 Replies)
Discussion started by: rajagasti
10 Replies

7. Shell Programming and Scripting

Shell script to move certain files on scheduled time

Hi Friends, I want a shell script which will move certain .jar files from a specified location (say /publish/content) to (/publish/archive) on every saturday morning 6 am. One more thing to add is that before moving files it must check free space at (/publish/archive), if it is more than 60 %... (7 Replies)
Discussion started by: abhishek27
7 Replies

8. UNIX for Dummies Questions & Answers

problem when the script is scheduled to run as cron job

Hello, I have problem in executing a shell script. When the shell script is executed at the shell prompt the script works successfully but when the same script is run as a cron job it fails to execute the files called within the shell script. I have scheduled the job in my crontab file as ... (6 Replies)
Discussion started by: forumthreads
6 Replies

9. Shell Programming and Scripting

Problem with executing a script scheduled in crontab

Hi I have written a shell script(in Solaris) in which following logic is there..... i=1 while read control do key=`echo $control | awk -F$DELIMITOR '{ print $1 }'` echo "Key Values" ${key} i=`/usr/bin/expr $i + 1` done < $CONFPATH/$CONFFILE when i execute it at prompt it... (4 Replies)
Discussion started by: Amardeep
4 Replies

10. Shell Programming and Scripting

Conditional File Movement script scheduled using CRON job

Hi All, i am trying to automate a process and have to create a unix script like wise. I have a scenario in which i need to automate a file movement. Below are the steps i need to automate. 1. Check whether a file (Not Fixed name-Pattern search of file say 'E*.dat') is present in a... (2 Replies)
Discussion started by: imu
2 Replies
Login or Register to Ask a Question