Skip to content

batch ftp from windows to linux using shell scripting

MintState November 28, 2013 at 9:49 AM Views 12803

batch ftp from windows to linux using shell scripting

I am a beginner. I am trying to write a bat file that I can run as a scheduled task from my windows server that will ftp (put) a file from windows to a linux box. I've been experiementing with 2 different scripts, neither are working. Can anyone recommend which path of shell scripting is a better path to work on? and/or any tips? thanks in advance.

option 1.

HOST=111.111.111.111
PASSWORD=xxx
USER=ftpuser
FILE_NAME=pg.mdb
ftp -v -n ${HOST} << cmd
user ${USER} ${PASSWORD}
cd /home/ftp/
lcd C:\test
ls ${FILE_NAME}
put ${FILE_NAME}
quit
cmd

Option 2.

cd c:/test
echo open 111.111.111.111/home/ftp>autoxfer.txt
echo user ftpuser>>autoxfer.txt
echo xxxx>>autoxfer.txt
echo binary>>autoxfer.txt
echo put pg.mdb>>autoxfer.txt
echo quit>>autoxfer.txt
ftp -v -n -s:autoxfer.txt

출처 : http://www.unix.com/showthread.php?t=195547

Share X Facebook LINE QR code

0 comments

Be the first to comment.