lftp a sophisticated ftp client – advanced options

lftp1

This is the final part of this series and we’ll learn how to connect to a ftp site when we are behind a proxy or firewall, scheduling tasks with at command and queuing jobs with queue command.

Connect to an ftp site, through a http proxy

$ vim .bashrc

Go at the end of the file with Shift-g and add

export ftp_proxy = http://user:passwd@servidor-proxy:puerto

Or

export http_proxy = http://user:passwd@servidor-proxy:puerto

Exit from vim with

Esc: wq!

Then

$ source .bashrc && lftp user:passwd@sitio-ftp

Also you can view: lftp behind a proxy

Creating alias

vim .lftp/lftprc

Add

alias ls 'ls -a'

Now every time you execute ls command, ls will displays all files, including the hidden ones

Executing a command at specific time

Very useful option to download big files in less traffic hours. It starts at 20:00 hours the downloading process of the iso of NetBSD.

> at 20:00 -- get NetBSD-7.0.1-amd64.iso

Run a command in background

When you run the above command, we can not do any operations on the ftp server until the transfer is done, hence the convenience to run it in background

> at 20:00 -- get NetBSD-7.0.1-amd64.iso&

Execute commands sequentially

First download the file my-dvd.iso and then removes it from the ftp site.

> queue get mi-dvd.iso
> queue rm mi-dvd.iso

See jobs that are in the background or in the queue

> jobs

lftp a sophisticated ftp client, 4 (4)

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.