[bash script] how to move files to remote FTP server automatically

the script is as simple as below, tested on centos, you can add the script to a cronjob to be scheduled or repetitivly executed.

destination path is the jain path for used FTP user

what to upload is a pattern assgined to FILES varialbe

#!/bin/sh

## destination FTP server IP
HOST=’192.168.xx.xx’

## username & PW
USER=’anonymous’
PASSWD=”
#patteren of moving
FILES=*.txt

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
prompt
mput $FILES
quit
END_SCRIPT

exit 0

enjoy 😉

shenno