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 ftp://my_ftp.com 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 ftp://my_ftp_login:my_ftp_password@my_ftp.com/www -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

    host my_ftp.com
    user my_ftp_login
    pass my_ftp_password