Passing parms to FTP Script??? [message #97326] |
Wed, 13 March 2002 14:44 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Jo
Messages: 16 Registered: September 1999
|
Junior Member |
|
|
I've generated an ftp script but I don't know how to pass it parms. I have scheduled a script to run daily to retreive files from ftp site which are a derivitive of the date. I can create the daily filenames with WSH but have not been successful in calling the ftpscript file with parms. Any help! I'll admit I'm not good with ftp.
|
|
|
Re: Passing parms to FTP Script??? [message #97330 is a reply to message #97326] |
Thu, 14 March 2002 11:09 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Grant
Messages: 578 Registered: January 2002
|
Senior Member |
|
|
You can dynamically create the script and put variables in it and execute it. Here is what I do in unix:
#!/bin/ksh
#
# Script to use FTP using a file created dynamically.
# 3/15/01 Grant_howell
#
# Get the password and plug it in PWD.
PWD=`cat $HOME/passwd/ams_system`
# Create the file to receive commands for FTP.
echo "Begin FTP Script..."
echo "open cronus" > ftptmp.scr
echo "user oracle $AMS_PWD" >> ftptmp.scr
echo "ascii" >> ftptmp.scr
echo "cd scripts" >> ftptmp.scr
echo "lcd ams" >> ftptmp
echo "mget *" >> ftptmp.scr
echo "cdup" >> ftptmp.scr
echo "close" >> ftptmp.scr
ftp -inv < ftptmp.scr
echo "END FTP Script..."
rm ftptmp.scr
Here is a DOS version (you can modify it to use %1, %2...):
echo off
echo open anteros > ftptmp.scr
echo user oratest %1 >> ftptmp.scr
echo binary >> ftptmp.scr
echo cd /ora/u1/test/testappl/ap/11.5.0/reports/US >> ftptmp.scr
echo put APXPBFEG.rdf >> ftptmp.scr
echo bye >> ftptmp.scr
echo on
ftp -inv < ftptmp.scr
del ftptmp.scr
echo END FTP Script...
|
|
|
|