Home Linux Community Community Blogs Personal FTP file transfer with an automated bash script

FTP file transfer with an automated bash script

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:


ftp -n -v $HOST << EOT
cd upload
ls -la

The script automatically connects to a remote server "" 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..





Subscribe to Comments Feed
  • Kalpana Said:

    Thanks for the script. Its simple and easy to use

  • Ken Diebel Said:

    Hello all, I have my user name and passsword for an FTP site that I want to access for information that is available to me to use from an FTP site .My goal is to access the FTP site at different times throughout the day and get specific tiime specific information and then pull it off the FTP site and store it at a specific location on my automation system and then play it back at specified times that I program on my automation system. Any help is appreciated.. Thank you.

  • Benjamin Said:

    I was trying to do this exact thing, and it's the -n flag that was missing. Thanks for this!

Upcoming Linux Foundation Courses

  1. LFD312 Developing Applications For Linux
    16 Feb » 20 Feb - Atlanta - GA
  2. LFD331 Developing Linux Device Drivers
    16 Feb » 20 Feb - San Jose - CA
  3. LFS220 Linux System Administration
    16 Feb » 19 Feb - Virtual

View All Upcoming Courses

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board