TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Linux & Opensource > Unix

Notices

bad return code in ncftpget

Unix


Reply
 
Thread Tools Display Modes
Old 16-11-2007, 06:33 PM   #1
droid
Guest
 
Posts: n/a
bad return code in ncftpget

As advised in this news group, I have switched from wget to ncftpget,
to backup my web site. But I am troubled by a bad return code in my
script.

----------- Snippet from "bak_website" bash shell script: -----------

echo "bak_website: Preparing to archive ftp://mywebsite.com"
ncftpget -RVd ../ncftpget.log -u user -p passwd ftp://mywebsite.com .

# move and list the archived files
val=$?
echo "return code=$val"
if [ $val -eq 0 ]; then
# move files from dir n to dir n+1
mvarc
else
echo "bak_website failed"
fi

----------------------------- End script -----------------------------

This is the output:

bak_website: Preparing to archive ftp://mywebsite.com
ncftpget: server said: File successfully transferred
return code=3
bak_website failed

On inspection, it seems the entire website (as far as I can tell) was
successfully transferred. The ncftpget.log file is 8KB - ncftpget
does a lot of business - but grepping it for "error", "fail" and
"warn" returns nothing.

I'm not sure what, if anything, is failing. I get consistent results
every run, total bytes downloaded increases a little each day, as you
would expect. Also, the total bytes are just slightly less than what
I get with wget, which makes sense because wget adds a ".listing" file
to each directory.

If I modify the ncftpget command line so it gets just a directory from
the site, the "File successfully transferred" message is not output
and
the return code=0. Could the return code be set to 3 by this server
message instead of by ncftpget?

--
Every solution breeds new problems.
  Reply With Quote
Reply

Thread Tools
Display Modes



< Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 10:04 PM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2009, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional