This one gave me fits for a couple whiles this afternoon. My commerce site ftp’s orders to another server for shipping. I was opening a pipe in perl to call ftp and send the file. Simple enough, worked for years and years.
Well, we recently upgraded our servers and intermittently I would get this message in the log:
ftp: u: unknown option
I was pulling my hair out because, subsequent to an updatedb, I’d issue a whereis:
[root@camera ~]# whereis ftp
ftp: /usr/bin/ftp /usr/share/man/man1/ftp.1.gz
OK, I’m in /usr/bin/ftp so let’s issue the command:
[root@camera ~]# /usr/bin/ftp -u
ftp: u: unknown option
What the haywire? How about plain old ftp, as it’s being issued by the apache server (sometimes, because sometimes it works, sometimes it doesn’t – that’s the part I like the least).
[root@camera ~]# ftp -u
ftp>
Plain weird. Finally, good old find and env found my answer: we’re calling /usr/kerberos/bin/ftp aren’t we? Yes, we are.
So, I supplied the full path to /usr/kerberos/bin to my ftp call in my Perl module, and everything works. The mystery of why the failure was intermittent remains unsolved. Anyone care to venture a guess? I’m curious, but I’m not looking for any more answers for now.
Thanks for this post. it helped me too. I had an issue trying to get crontab to run a BASH script which was ftping a file to another server. took me all day to sort it but with you mentioning ftp in the kerboros path I managed to specify the full path to ftp which has sorted the issue of it not working.
Cool thanks man! I was getting this too but also only sometimes so was confusing me quiiiiite badly.
Thanks a lot mate. I also kinda fell into that weird zone, but thanks to your post. Helped me to figure it out and correct the script.