Bash - rewriting files on FTP server

Posted on Fri 01 January 2010 by Pavlo Khmel
#!/bin/bash
HOST='phn.org.ua'
USER='phn'
PASSWD='PhnPassw0rd!'
ftp -p -n -v $HOST << EOT
ascii
user $USER $PASSWD
prompt
cd www
# Only files will be removed, but not directory
mdelete ./*
mput ./* ./
mput ./server/* ./
mput ./security/* ./
mput ./general/* ./
mput ./desktop/* ./
mput ./from-internet/* ./
quit
EOT