Lftp & exit

Résolu
Bonjour,

J'ai un script LFTP :
#!/bin/sh

HOST="123.123.123.123"
USER="moi"
PASS="password"
SRC="/var/source"
DEST="/ftpgroups/destination"

lftp -e '-R '$SRC' '$DEST' set ftp:list-options -a' -u $USER,$PASS $HOST


J'aimerai qu'une fois exécuté, celui se ferme automatiquement car actuellement, je suis obligé de taper exit...
$ su monscript.sh
lftp moi@123.123.123.123:/> exit
$


J'ai donc essayé avec -c :
OPTIONS
       -e commands
              Execute given commands and don't exit.

       -c commands
              Execute  the given commands and exit. Commands can be separated with a semicolon, '&&' or '||'. Remember to quote the commands argument properly in the shell.   This  option must be used alone without other arguments.


mais j'obtiens l'erreur : Commande inconnue « mirror ...

Une idée ?

Merci d'avance

1 réponse

  1. Contributeur
    Salut,

    lftp -u ${USER},${PASS} ${HOST} -e "set ftp:list-options -a ; mirror -R ${SRC} ${DEST} ; exit

    ;-))
    1. hello zipe31 !

      malheureusement, cela ne change rien...
      avec ceci dans mon script :
      lftp -u $USER,$PASS $HOST -e 'set ftp:list-options -a; mirror --just-print -R '$SRC' '$DEST; exit


      J'ai toujours la commande lftp en exécution :
      $ su monscript.sh
      lftp moi@123.123.123.123:/> 


      :(
    2. Contributeur
      Mets des quotes doubles autour de l'expression et non des quotes simples...

      Sinon essayes :

      lftp -c "set ftp:list-options -a ; open -u ${USER},${PASS} ${HOST}; mirror -R ${SRC} ${DEST}"
    3. la dernière soluce est la bonne
      MERCI !!!! ;)
    4. Contributeur
      Oups j'ai oublié la quote fermante ;-((

      lftp -u ${USER},${PASS} ${HOST} -e "set ftp:list-options -a ; mirror -R ${SRC} ${DEST} ; quit"