Alexander V. Lukyanov | 6 Oct 07:58 2011
Picon

Re: mirror to custom dir?

On Fri, Sep 30, 2011 at 02:06:42PM +0200, Niklas Janzon wrote:
> To clear, if I doing as explained here, it will make a dir namned
> /test/dir/ftp:home/ and put all files inside that. :/

Please test this patch.

--
   Alexander.
diff --git a/src/MirrorJob.cc b/src/MirrorJob.cc
index 51bd2c8..4b945d6 100644
--- a/src/MirrorJob.cc
+++ b/src/MirrorJob.cc
 <at>  <at>  -1656,8 +1656,10  <at>  <at>  CMD(mirror)
 	 {
 	    // user wants source dir name appended.
 	    const char *base=basename_ptr(source_dir);
-	    if(base[0]!='/' && strcmp(base,basename_ptr(arg)))
+	    if(base[0]!='/' && strcmp(base,basename_ptr(arg))) {
 	       target_dir=xstring::cat(target_dir,base,NULL);
+	       target_dir=alloca_strdup(target_dir); // save the buffer
+	    }
 	 }
       }
       else
 <at>  <at>  -1665,8 +1667,10  <at>  <at>  CMD(mirror)
 	 target_dir=basename_ptr(source_dir);
 	 if(target_dir[0]=='/')
 	    target_dir=".";
(Continue reading)

Simón | 9 Oct 13:20 2011
Picon

[OT] Prevent temporally suspend/hibernate from script?

Hi,
This doubt isn't specifically about lftp but it involves. When I 
download several files from my server via lftp, it can take hours to 
complete. How prevent temporally suspend/hibernate from script?
Regards.
_______________________________________________
lftp mailing list
lftp <at> univ.uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp

Simón | 13 Oct 18:13 2011
Picon

Best values for a fast reconnection

Hi,
Actually I have this values to reconnect:

    set net:reconnect-interval-base 10;
    set net:reconnect-interval-multiplier 1.2;
    set net:reconnect-interval-max 30;

But with this values, lftp takes several minutes to reconnect. Which are 
the best values for a fast reconnection?
Regards.
_______________________________________________
lftp mailing list
lftp <at> univ.uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp

Alexander V. Lukyanov | 14 Oct 08:31 2011
Picon

Re: Best values for a fast reconnection

On Thu, Oct 13, 2011 at 06:13:50PM +0200, Simón wrote:
>    set net:reconnect-interval-base 10;
>    set net:reconnect-interval-multiplier 1.2;
>    set net:reconnect-interval-max 30;
> 
> But with this values, lftp takes several minutes to reconnect. Which
> are the best values for a fast reconnection?

Probably you also need to set net:timeout to a low value (e.g. 30 seconds).
Turn on debug and see what happens.

--

-- 
   Alexander.
_______________________________________________
lftp mailing list
lftp <at> univ.uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp

Simón | 14 Oct 10:57 2011
Picon

Re: Best values for a fast reconnection

Thanks. This is the solution.

El vie 14 oct 2011 08:31:32 CEST, Alexander V. Lukyanov escribió:
> On Thu, Oct 13, 2011 at 06:13:50PM +0200, Simón wrote:
>>     set net:reconnect-interval-base 10;
>>     set net:reconnect-interval-multiplier 1.2;
>>     set net:reconnect-interval-max 30;
>>
>> But with this values, lftp takes several minutes to reconnect. Which
>> are the best values for a fast reconnection?
>
> Probably you also need to set net:timeout to a low value (e.g. 30 seconds).
> Turn on debug and see what happens.
>
_______________________________________________
lftp mailing list
lftp <at> univ.uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp
Augusto Destrero | 14 Oct 11:31 2011

Mirroring during the day and during the night at two different transfer rates

Hi there,
I'm new to the list and I have a question I couldn't answer searching on the 
web.
I'm using lftp to perform a big mirror between two servers.

I want to give lftp the maximum bandwidth only during night and weekends 
because one of the servers is a production web server and I don't want to 
saturate its bandwidth during the day.

My current strategy is to use two different scripts to start the mirroring: the 
first is "slow_mirror.lftp":

debug -o /var/log/lftp_mirror.log 3
open example.com
user myuser mysecret
set net:connection-limit 1
set net:limit-rate 204800
mirror -c --use-cache . /home/mirror
exit

and the other is "fast_mirror.lftp":

debug -o /var/log/lftp_mirror.log 3
open example.com
user myuser mysecret
mirror -c --use-cache . /home/mirror
exit

The I have some cron jobs which kills lftp and restart it with the appropriate 
script in the morning and in the evening.
(Continue reading)

Alexander V. Lukyanov | 14 Oct 12:43 2011
Picon

Re: Mirroring during the day and during the night at two different transfer rates

On Fri, Oct 14, 2011 at 11:31:07AM +0200, Augusto Destrero wrote:
> Is there a way to change the transfer rate of a mirror on the fly without
> restarting the lftp process?

Yes, use this script:

    repeat at 23:00 "set net:limit-rate 0" &
    repeat at 09:00 "set net:limit-rate 204800" &
    mirror -c . /home/mirror
    exit kill

Run this script at night, or add another line to limit the rate at the start.

You can even change mirror to "repeat mirror" to run it in a loop.
Variations:
    repeat 4h mirror ...
	add a 4 hour break between mirrors
    repeat at 23:00 mirror
	start next mirror at 23:00

Then the script never ends and you can start it from the init scripts.

--
   Alexander.
_______________________________________________
lftp mailing list
lftp <at> univ.uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp

(Continue reading)

Augusto Destrero | 14 Oct 12:54 2011

Re: Mirroring during the day and during the night at two different transfer rates

In data Friday 14 October 2011 12:43:12 Alexander V. Lukyanov ha scritto:
> On Fri, Oct 14, 2011 at 11:31:07AM +0200, Augusto Destrero wrote:
> > Is there a way to change the transfer rate of a mirror on the fly without
> > restarting the lftp process?
> 
> Yes, use this script:
> 
>     repeat at 23:00 "set net:limit-rate 0" &
>     repeat at 09:00 "set net:limit-rate 204800" &
>     mirror -c . /home/mirror
>     exit kill
> 
> Run this script at night, or add another line to limit the rate at the
> start.
> 

Thank you very much Alexander! LFtp is so much awesome I can't believe it 
exists!

--

-- 
Augusto Destrero
info <at> guguweb.com
_______________________________________________
lftp mailing list
lftp <at> univ.uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp

Gary D Walborn | 14 Oct 14:18 2011
Picon

Variables....

Hello to all:

   I am a new user of lftp and am quite happy thus far.  I guess I'm a little confused about "variables".  It appears that you can't define NEW variables, but rather can only change the variables that are predefined in the system.  Am I missing something?  Also, is there no way to access the values of environment variables in lftp?  If not, it would be a fabulous improvement to lftp to allow use of variables in the way that bash does.  Any thoughts?

--
Gary D. Walborn
gwalborn <at> gmail.com


_______________________________________________
lftp mailing list
lftp <at> univ.uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp
Justin Piszcz | 14 Oct 14:30 2011

Re: Variables....

Hi,

To see what you can set:
lftp> set -a

Put any set commands in your $HOME/.lftprc, e.g.:
set cmd:verify-host no
set cmd:verify-path no

You can add aliases in the lftprc, e.g.:
alias lm set net:limit-total-rate 2500:2500

Does this answer your question?

Justin.

On Fri, 14 Oct 2011, Gary D Walborn wrote:

> Hello to all:
>
>   I am a new user of lftp and am quite happy thus far.  I guess I'm a
> little confused about "variables".  It appears that you can't define NEW
> variables, but rather can only change the variables that are predefined in
> the system.  Am I missing something?  Also, is there no way to access the
> values of environment variables in lftp?  If not, it would be a fabulous
> improvement to lftp to allow use of variables in the way that bash does.
> Any thoughts?
>
> -- 
> Gary D. Walborn
> gwalborn <at> gmail.com
>
_______________________________________________
lftp mailing list
lftp <at> uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp


Gmane