lftp - perform task only if connect successful
I have an lftp script that runs from cron. But I only want mv of files to take place if the connect is successful. So did the mv within the lftp script but the mv takes place even if the login fails. How can I conditionally mv the files ? Here is my script:
lftp -u user,pw -e 'set xfer:clobber yes;
!mv *.* /commerce/ediftpoutwork;
!mv *.* /commerce/edioutarchive;
Thanks in advance for any help.