Lftp & exit

Résolu
Tchupacabra Messages postés 105 Statut Membre -  
zipe31 Messages postés 34620 Date d'inscription   Statut Contributeur Dernière intervention   -
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. zipe31 Messages postés 34620 Date d'inscription   Statut Contributeur Dernière intervention   6 501
     
    Salut,

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

    ;-))
    0
    1. Tchupacabra Messages postés 105 Statut Membre 9
       
      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:/> 


      :(
      0
    2. zipe31 Messages postés 34620 Date d'inscription   Statut Contributeur Dernière intervention   6 501
       
      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}"
      0
    3. Tchupacabra Messages postés 105 Statut Membre 9
       
      la dernière soluce est la bonne
      MERCI !!!! ;)
      0
    4. zipe31 Messages postés 34620 Date d'inscription   Statut Contributeur Dernière intervention   6 501
       
      Oups j'ai oublié la quote fermante ;-((

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