LFTP if no connection cancel thread and move on

668 views Asked by At
lftp -u user, password -p 2121 -e 'set net:timeout 10; set net:reconnect-interval-base 1; set net:max-retries 1; mirror -R --use-pget-n=10 -v -c /home/[username]/files/sync/. /' {$v[ip]}

I have a script that grabs the ip of everything connected to the network and attempts to push a file to it. There will be things on the network that won't allow a connection. There's no way to know in advance what will be on the network and what wont, and I need to find a way for lftp to not hang on a failed connection so the script can move into the next ip/hostname.

1

There are 1 answers

0
Lilbnyfufu On

The answer ended up being an actual issue with the Ubuntu version and some of the files not being able to handle itself. By updated the Ubuntu version to 15 it fixed the hanging issues.