Hi there

 

I'm new to this list :o)

 

And I'm going to start with a big ask :o)

 

Here we go.

 

I have a box that is on a limited downstream pipe but unlimited upstream.

 

I have been allocated 2 M'Bit of bandwidth down.

 

Any bandwidth used over that is charged.

 

Since the use of the box usually only requires 1 - 1.5 mbit during those times of low 
usage I use lftp to download or mirrors files from ftps to the local ftp for users to 
download.

 

Using the net:limit-total-rate I'm able to restrict the speed in which downloads occur 
and any new downloads are added to the existing copy of lftp running in a virtual 
screen console using background processes lftp jobs and queues ( lftp is the best and 
I mean best when it comes to queues and threading ).

 

Problem is I want some way to make lftp be automated by an external script.

 

I have an external bash script capable of using mtrg logs from the box which computes 
my data usage that can work out how much free bandwidth is currently available. I wish 
to get the script to modify the net:limit-total-rate value in lftp so as to not go 
over 2mbit while allowing fast downloading during times when the links free.

 

I have though of 2 possibilities

 

1 ) A sigusr is added that when called the command shell of lftp would execute a pre 
coded rc file.  Be it the current ~/.lftp/rc file which would be pre modified by the 
script before it hups lftps process.

 

or

 

2 ) Using the delay command run a shell script on a regular basis and have the output 
redirected to net:limit-total-rate.

 

I have tried net:limit-total-rate !/scripts/getlftpcps but it doesn't seem to work :(

 

Is there the ability to facilitate this within lftp or will it be required to be added

 

If so is anyone willing to help with adding this functionality into lftp or provide me 
pointers on the code segments in lftp to help with the handling of the sig's and the 
points in the code I would need to work with.

 

I'm a proficient coder and have looked over lftps source.

 

Alas I don't have allot of time and at the moment net:limit-total-rate 16000 does the 
trick.

 

slow but never puts me over

 

Any ideas / help ;P

 

Jonathan M

Reply via email to