- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ftp return values from within shell scripts
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
Discussions
Discussions
Forums
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
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
тАО08-02-2000 12:08 PM
тАО08-02-2000 12:08 PM
ftp return values from within shell scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2000 12:08 PM
тАО08-02-2000 12:08 PM
Re: ftp return values from within shell scripts
return code is difficult.
What about logging the error output of the ftp command ?
Just redirect with 2>/tmp/ftperr.log
an look then for any contents in it
(
if [ ! -s /tmp/ftperr ]; then
#your error actions
fi
).
If it is empty the ftp should be successfully.
Regards
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2000 12:16 PM
тАО08-02-2000 12:16 PM
Re: ftp return values from within shell scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2000 12:46 PM
тАО08-02-2000 12:46 PM
Re: ftp return values from within shell scripts
My experience is the same as Andreas & Rick.
I run my ftp scripts with the verbose option (-v) and tee or redirect output to a logfile. I also like to use the 'hash' mark to record progress.
The intermediate and final replys of the ftpd are recorded as 3-digit values (see: man ftpd) in the redirected output log, along with an textual translation. You could awk to isolate key values like "226" which denotes a successful transfer.
Depending on the server to which you connect (UNIX, NT, etc.) the text associated with the value may differ. For instance, #226 is "Transfer complete" as well as "Transfer finished successfully.".
If you are doing 'gets', the presence of a file can be used to signal a "successful" ftp.
Needless to say, none of this is direct.
...JRF...
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2000 12:53 PM
тАО08-02-2000 12:53 PM
Re: ftp return values from within shell scripts
I've done somthing like that.
The script is in attachment.
It is part of a bigger script, but the stuff you want to do is in there.
Bye,
Rik