In my case I want to put a tray icon when lftp goes background and delete this icon when lftp terminates or goes to foreground. With the actual commands I can't do this.

El jue 24 ene 2013 15:48:15 CET, J1 Simón escribió:
I've tested the git version adding the next lines to my rc file:

    set cmd:at-exit "!echo `date` at-exit >> /tmp/lftp-exit";
    set cmd:at-exit-fg "!echo `date` at-exit-fg >> /tmp/lftp-exit";
    set cmd:at-exit-bg "!echo `date` at-exit-bg >> /tmp/lftp-exit";


And this the result:

I open lftp and exit (not backgrounded):

    15:31:32 at-exit
    15:31:32 at-exit-fg

I open lftp, I execute "queue repeat -d 10 ls" and exit (backgrounded):

    15:33:28 at-exit


I attach the last session backgrounded, I kill the job and exit:

    15:34:16 at-exit
    15:34:16 at-exit-fg
    15:34:16 at-exit
    15:34:16 at-exit-fg


I open lftp , I execute "queue repeat -c 5 -d 5 ls", exit
(backgrounded) and I wait to terminate backgrounded lftp:

    15:35:23 at-exit
    15:35:42 at-exit-bg
    15:35:42 at-exit-fg

I can see:

 1. "at-exit" is executed always. Is this setting really useful?
 2. In 4th case are executed 2 times "at-exit" and "at-exit-fg". I
    think this is a bug.
 3. In last case is executed "at-exit-fg" but lftp was backgrounded.

I think these settings are almost unusable.
How can I execute something when lftp goes to background?
How can I execute something when lftp terminates?
Regards.


El jue 24 ene 2013 12:05:06 CET, Alexander V. Lukyanov escribió:

On Thu, Jan 24, 2013 at 11:58:24AM +0100, J1 Simón wrote:

El jue 24 ene 2013 08:30:55 CET, Alexander V. Lukyanov escribió:

So let's add cmd:at-exit-fg which will be executed when lftp terminates
in foreground. cmd:at-exit will be executed when lftp either terminates
in foreground or moves to background, just like now.


But this way "at-exit" and "at-exit-fg" have almost the same
behaviour. And it still doesn't exist a command to execute at
totally finish of lftp (background and foreground).


You can set at-exit-fg and at-exit-bg to the same value.

But it is possible to add another setting, like cmd:at-terminate.
_______________________________________________
lftp mailing list
lftp@uniyar.ac.ru
http://univ.uniyar.ac.ru/mailman/listinfo/lftp

Reply via email to