How to make full backup of your website via ftp using a Linux command line ?

First let’s suppose that :

  • your ftp login is « my_ftp_login »
  • your ftp password is « my_ftp_password »
  • your ftp website is and your ftp remote directory to backup is « /www »
  • your local directory to store your backup is « /data/my_local_backup_directory »

Below are 2 available Linux command lines to make this full website backup :

  • First one is using « wget » command
    wget -r -P /data/my_local_backup_directory
  • Second one is using « ncftpget » command
    ncftpget -v -f ./ncftpget.cfg -R /data/my_local_backup_directory   '/www'

    with ncftpget.cfg a ncftpget config file with following contents

    user my_ftp_login
    pass my_ftp_password