fttp script

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sainath
Premium Member
Premium Member
Posts: 138
Joined: Fri Nov 19, 2004 3:57 pm

fttp script

Post by sainath »

Hi
I wrote a following script to move a file to a remote location.i want to move all the files like TD_ORD_SDAO* from local to remote location.
but it is giving error
SH: mput: not found.
`cd #LocalPath#ETL_FINALIZEDPROPOSAL/; echo 'user #UserName# #PasswordName#\n cd #RemotePath#\n mput #RemoteFileName#' | ftp -n #ServerName#`
please share your thoughts
thks
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

my thoughts are that mput is not in your path
sainath
Premium Member
Premium Member
Posts: 138
Joined: Fri Nov 19, 2004 3:57 pm

ftp script

Post by sainath »

Hi
mput is there in my code before REmoteFIleName.
how can i mention to move all the files in local location to remote loation
`cd #LocalPath#ETL_FINALIZEDPROPOSAL/; echo 'user #UserName# #PasswordName#\n cd #RemotePath#\n mput #RemoteFileName#' | ftp -n #ServerName#`
thks
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Just to make, which os are you on?
Check if you have mput is in your path.

If unix, type this on your prompt and see what response you get

Code: Select all

which mput
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why would mput need to be in anyone's path? :?

It's an ftp command and needs to be executed inside your ftp session, not outside of it as you have it now. And that requires a little 'here document' action. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
sainath
Premium Member
Premium Member
Posts: 138
Joined: Fri Nov 19, 2004 3:57 pm

Post by sainath »

hi
Can you explain it more in detail where i have to modify the fttp script
thks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Google for something like 'here document ftp script' and you should find lots of examples of what is meant by that.

One such example.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply