Command Line FTP and SFTP Upload or Download of Backup Files from Web Server

Using command line to download or upload files, from and to a web server can be really helpful. Without the need of Graphical User Interface (GUI), the power of using command line is equally good, if not better. Apparently, there is minimal resource requirement, yet the requirement to fulfill the task remains adequate.

Below, I will introduce how to simply use command line; that is using "ftp" and "sftp" commands in Linux to carry out file transfer operations.

(click here to read more on how to use command lines for FTP and SFTP...)

This tutorial requires user with a little bit of Linux terminal console knowledge. It should not be too difficult to pick up on that, as only a few commands is required.

Backup File with cPanel
This is a simple example of a file created or residing in your web server that you might want to download. For example, a backup file from cPanel.

  1. Access backup function in cPanel.

  2. Generate backup of your website.

  3. This should immediately activate the cPanel to create an archived backup in .tar.gz format and saved it in your home directory, e.g.
    /home/[myusername]/

  4. assuming that [myusername] is the username of your account on the server.

Once the backup has completed, it is time to download from the webserver. There are two methods to do so; either FTP or SFTP (using secure connection, provided you are granted permission by the administrator to use SSH).

Logging On Using FTP

  1. Firstly, open up a terminal console.
  2. Next, type in the following command (replace "mywebserver.com" with the domain name of your server):
    ftp mywebserver.com

  3. Type in your username and press [Enter].
  4. Type in your password and press [Enter].
  5. You should now be connected to the server using FTP protocol.

In case that you are unable to log on, you may want to check your password or your permission to access or use the FTP protocol on that web server.

Logging On Using SFTP (SSH)
In order to use SFTP, please check with your system administrator that you are granted permission to use SSH. If not, you are quite unlikely to use SFTP to transfer your file.

  1. Again, open up a terminal console.
  2. Next, type in the following command (replace "mywebserver.com" with the domain name of your server):
    sftp username@mywebserver.com

  3. Type in your password and press [Enter].
  4. You should now be connected to the server using SFTP protocol.

After gaining access to your system with FTP or SFTP, the next step is to download or upload file between your server and your local machine. Note that, your local machine has to be running Linux in order to use this protocol.

Download File With FTP or SFTP
The methodology below can be used with both file transfer protocol, i.e. FTP or SFTP.

  1. After gaining access to the web server, check the file on the current directory by typing:
    ls -l

    If the file does not exist, then access to the directory with "cd" command.

  2. Download file (e.g. myfile-backup.tar.gz):
    get myfile-backup.tar.gz

  3. Download will automatically commence. Just wait for it to end.

Upload File With FTP or SFTP
The methodology below can be used with both file transfer protocol, i.e. FTP or SFTP.

  1. After gaining access to the webserver, check the file on the current directory by typing:
    ls -l

    If the file does not exist, then access to the directory with "cd" command.

  2. Download file (e.g. myfile-upload.zip):
    put myfile-upload.zip

  3. Upload will automatically commence. Just wait for it to end.

Hence, it is extremely easy to use command line to upload and download files to and from another server, that is running on Linux.


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Use <!--pagebreak--> to create page breaks.
More information about formatting options

Syndicate, Bookmark & Sitemap

Syndicate Content Bookmark This Site NeoHide SiteMap

Quick Search

User login

Search

Sponsored Ads

Women's Corner

Who's new

  • akibsayyed
  • biomarwan
  • movjerap
  • hackernet
  • sZwCGKObKbpH

Syndicate

Syndicate content

FastBox Ad Feed

Subscribe Feeds

Feed Icon
Google
Yahoo!
Bloglines
Newsgator
MSN
Feedster
AOL
Furl
Rojo
Newsburst
Pluck
FeedFeeds
Add Kinja
SoloSub
MultiRSS
rMail
RSSFwd
Blogarithm
Eskobo
GritWire
BotABlog
Monitor This
Simplify