Hi,
I am a DBA and I need to move data from Unix box to Window (XP) daily through ftp process.
I wrote a korn shell script and I can manually run it without any problem. However, once I schedule
a cron job and it always failed at the line which asked me to enter user id and password. Here is my sample script:
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----------
---
cd /u/staff/run/PCR -- my process directory
#Start building FTP Process
date
prompt off
ftp -i 172.23.10.84 -- window directory ip address
prompt off
user=anonymous -- this part does not work
password="" -- this part does not work
cd PrimeClinical/PCR/a1099/C1
0 -- window directory path
lcd /u/staff/run/PCR/data10 -- Unix side data directory
mput * -- ftp command
date
bye
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
---------
Every time I run this script, it will connect to the ip address and ask me to enter the user id, then password, ........I need to manually feed in the information again. I thought I have provide the user
id and password in the code and use prompt off to avoid it asking me question. Obviously, it did
not work. I have a .netrc file in my home directory and it points to the machine name, my login id
and password. Please advise me where should I change my script to get my job run smoothly
without being interrupted by asking me enter the user name and password on the screen. By
the way, I have to use anonymous as the user name since we don't really have a user id & password
to access ftp here
Thanks a lot.
Warren Wang
DBA/Data Analyst
Start Free Trial