Are any of the exit codes working correctly ? It appears mget doesn't work but get does. Why do they differ ?
[cfern...@redford dev_test]$ /usr/bin/lftp -e 'set cmd:verbose yes; set net:max-retries 3; ; set sftp:connect-program /usr/bin/ssh -i /oracle/10g/admin/scripts/dev_test/id_dsa; mget *.ccsv; bye;' -u user,xx sftp://my.host.com:23 *.ccsv: no files found [cfern...@redford dev_test]$ echo $? 0 [cfern...@redford dev_test]$ /usr/bin/lftp -e 'set cmd:verbose yes; set net:max-retries 3; ; set sftp:connect-program /usr/bin/ssh -i /oracle/10g/admin/scripts/dev_test/id_dsa; get file.ccsv; bye;' -u user,xx sftp://my.host.com:23 get: Access failed: No such file (file.ccsv) [cfern...@redford dev_test]$ echo $? 1 [cfern...@redford dev_test]$ rpm -q lftp lftp-3.0.6-4.el4 It's very hard to use lftp for automated processes this way. Has this been address in later version ? I'm still on rhel4. On Thu, Oct 8, 2009 at 2:25 AM, Sorin Sbarnea <[email protected]>wrote: > I found a similar limitation that does prevent me from using the > script in automaton in a proper way. > I cannot know from the returned code if the error is a permanent error > or a temporary error. For some errors retry will work: server busy, > concurrent access limitations but others are permanent like: login > denied for bad user/password. > > Also I found out that exit codes are not documented :( > > -- > /sorin > http://nusunt.eu > > On Thu, Oct 8, 2009 at 09:00, stucky <[email protected]> wrote: > > Support > > > > Why does lftp exit with 0 here when it found no file to upload ? > > > > [cfern...@redford dev_test]$ /usr/bin/lftp -e 'set cmd:verbose yes; set > > net:max-retries 3; mput SCEA_FR_up.csv; exit;' -u user,xx > > sftp://my.host.com:23 > > SCEA_FR_up.csv: no files found > > [cfern...@redford dev_test]$ echo $? > > 0 > > [cfern...@redford dev_test]$ > > > > How can I capture the correct exit code from mput ? > > > > Thanks for your help > > -- > > stucky > > > -- stucky
