Thursday, February 21, 2013

Shell Script to FTP Files

#!/bin/bash

HOST='192.168.1.200'
USER='test'
PASSWD='test'
DIR='/home/test'
FILES='*.dat'

ftp -n $HOST <<END_SCRIPT
user $USER $PASSWD
cd $DIR
ascii
prompt
mput $FILES
quit
exit 0
END_SCRIPT