LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Regarding FTP script (https://www.linuxquestions.org/questions/linux-newbie-8/regarding-ftp-script-570008/)

chnlinux 07-17-2007 02:21 AM

Regarding FTP script
 
Hi ,

I want a UNIX FTP script to transfer a file from one server to another server.
Then use that FTP script in command task to execute.
Please find the script I have created.
#!/bin/sh
ftp
open myserver.com
userid\pw
ASCII
lcd /apps/informatica/powercenter/server/TgtFiles/ods/helix/output
mput HelixProduct*.xml
close quit

I want to test between the two servers and make it as a executable unix script


Thanks&Regards,
CHN

wjevans_7d1@yahoo.co 07-17-2007 06:30 AM

Fine. What's your question?

spaniel 07-17-2007 07:48 AM

He probably wants us to write the script for him/her...........
 
And since i am in a good mood and going on vacation in two days........... :p

------------------------------------------
#!/bin/bash
MYUSERNAME=<put in your username>
MYPASSWORD=<put in your password>
MYHOST=<put in the ip-address or hostname>

ftp -n $MYHOST <<EOF
user $MYUSERNAME $MYPASSWORD
ASCII
lcd /apps/informatica/powercenter/server/TgtFiles/ods/helix/output
mput HelixProduct*.xml
bye
EOF
------------------------------------------
Save it to a file, "chmod +x" it and have fun :cool:


All times are GMT -5. The time now is 04:21 AM.