This is a really quick blog post, I don’t wanna bother you with a complete article related to FTP, this morning I’ve had to automate a batch job, this job needs to transfer local data to a remote FTP server here’s what I’ve done:
#!/bin/bash
HOST='your.ftp.site'
USER='remoteusername'
PASSWD='remotepasswd'
ftp -n -v $HOST << EOT
ascii
user $USER $PASSWD
prompt
cd upload
ls -la
bye
EOT
The script automatically connects to a remote server “your.ftp.site” with a defined username/password pair (remoteusername, remotepasswd) and execute some commands in the middle, in my case :
cd upload
ls -la
but of course you can customize with your own commands
This is not a tech article and not even something cool, just useful as a quick tip for a newbie, hope it helps..
Ben