Uses of LFTP in Linux Server Management

lftp-linux-server-managementToday most of of people use control panel like cPanel, Plesk, DirectAdmin, Webmin, ISPConfig etc for linux server management. But there are still many people who prefer and use plain lamp server. As they have been using it for years and find it much easier.¬† The control panels provide automated remote ftp backup feature and it automatically upload multiple files to remote ftp backup server. Now within plain linux servers it’s a real pain writing custom script for creating backups and uploading the files.

Now a lazy linux system administrator like me will always find an simple and easy way to do this instead of writing the complex scripts. Now with a little research I was able to find command line program call Lftp. FTP is a sophisticated ftp/http client, and a file transfer program supporting a number of network protocols. Like BASH, it has job control and uses the readline library for input. It has bookmarks, a built-in mirror command, and can transfer several files in parallel. It was designed with reliability in mind. LFTP is free software, distributed under the GNU GPL license.

 

Below are the lftp commands for uploading and downloading  files and folders recursively.

Recursive File Upload

lftp -e 'mirror -R /local/directory/path/ /remote/backup/directory' -u user,password ftp.your-remote-backup-server.com

The -R switch means “reverse mirror” which means “put” [upload].

Recursive File Download

lftp -e 'mirror  /remote/backup/directory /local/directory/path/ ' -u user,password ftp.your-remote-backup-server.com

About 

Sreejit is the founder of Server Management Plus. His motto is "If there's an easier way, Why do it any other way" and following it, he has created a lots of automation scripts for the company using which we are able to resolve issue at an extremely fast rate and save lots of time. He has a very keen interest in new technologies and spend most of his free time online researching about it apart from listening music and watching movies.