- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- EXIT status of FTP command
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2008 02:15 AM
05-02-2008 02:15 AM
EXIT status of FTP command
I want to get the exit status of FTP command,like if the user name and password is correct. If the file has transfered completely. Based on the success or failure I need to comtinue with the script. I am trying to write in C shell.
Can u please help me.
Thanks in Advance.
- Tags:
- csh
- exit status
- ftp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2008 02:25 AM
05-02-2008 02:25 AM
Re: EXIT status of FTP command
if you run the ftp manually and transfer the file you will have the data you are looking to check.
HTH
Chris.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2008 02:56 AM
05-02-2008 02:56 AM
Re: EXIT status of FTP command
The posix shell or ksh is superior.
- Tags:
- scummy C shell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2008 03:02 AM
05-02-2008 03:02 AM
Re: EXIT status of FTP command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2008 03:28 AM
05-02-2008 03:28 AM
Re: EXIT status of FTP command
You would need your script to run "side by side" with /usr/bin/ftp, reading its output and issuing the appropriate commands. This is hard to do with just a shell script, because /usr/bin/ftp is designed mainly for interactive use. An additional scripting utility like "expect" would make it possible, but using a FTP client with more powerful native scripting features would be even easier.
If you need a FTP transfer solution that can be scripted to handle any errors... may I suggest using a different FTP client instead? The old "Kermit" is no longer a simple modem-based file transfer protocol which it was in the 1980s: it has become a full-featured file transfer suite which supports many protocols.
HP-UX includes C-Kermit 7.0, which can do many things but cannot do FTP. But if you can install C-Kermit 8.0, it contains a built-in FTP protocol, which is fully scriptable using C-Kermit's own very powerful scripting language.
http://www.columbia.edu/kermit/ck80.html
http://www.columbia.edu/kermit/ck80binaries.html#hp
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2008 04:01 AM
05-02-2008 04:01 AM
Re: EXIT status of FTP command
If you are doing FTP commands in a shell script (regardless of the shell --- csh, ksh, bash or Posix) you are going to have to parse the text and/or the three-digit messages that are emitted for each command. See the 'ftpd(1M)' manpages for more on this.
Essentially in a shell script you enable verbose logging ('-v') during the FTP transfer to do this. For instance, you would need to look for something like this in your captured log to signify a succesful file transfer:
226 transfer complete
The actual text may vary with different servers.
You can avoid this pain if you write your FTP scripts in Perl using Perl's 'Net::FTP'. This allows straightfoward logic, like:
$ftp->login() or die "..."
and:
$ftp->put($localf, $remotef) or die "..."
Regards!
...JRF...