- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ftp scripting,
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
07-31-2001 08:00 AM
07-31-2001 08:00 AM
How to get back the pid of a background process (script ftp) in a variable to follow it by program ?
We need to know the result of the ftp to continue because the session remains hung on even if it is inactive.
Thanks,
Nora
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2001 08:03 AM
07-31-2001 08:03 AM
Re: ftp scripting,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2001 08:11 AM
07-31-2001 08:11 AM
Re: ftp scripting,
The 'ftp' session doesn't return an exit value denoting success or failure, and that can make scripting to find the success or failure of a session a bit of a pain.
If you really want to decipher success/failure you can parse the three-digit numbers included with the reply from each ftp command. To do this in an ftp script, you can redirect verbose output into a logfile and parse the replys. See "man 1M ftpd" for a discussion of the format of the reply messages.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2001 08:25 AM
07-31-2001 08:25 AM
Re: ftp scripting,
Please Mr Clay correct me if I am wrong but if you do
#./script &
it gives you the pid when it is executed in the background. It gives me the same pid that
$! gives me. But the output says
sh: 27138: not found. Is that what it is supposed to do ?
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2001 08:36 AM
07-31-2001 08:36 AM
Re: ftp scripting,
See this recent thread for a discussion of tracking background processes:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0xfe7387dc4d7dd5118ff00090279cd0f9,00.html
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2001 08:46 AM
07-31-2001 08:46 AM
Re: ftp scripting,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2001 08:57 AM
07-31-2001 08:57 AM
Re: ftp scripting,
I have solved my ftp problems with a script that I have
included with this reply. The server, user, and password are located in a file in /etc/local directory and is into the
script upon startup.
Hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2001 09:25 AM
07-31-2001 09:25 AM
Re: ftp scripting,
When I have to do ftp scripting these days, I use perl with the Net::FTP module (available for download at www.perl.org/CPAN). It really makes FTP operations very simple. Any error conditions and timeouts are easy to test for and set. It you don't know perl, now would be a good time to learn.
It's usually something as simple as this (with error checking omitted):
use Net::FTP;
$ftp = Net::FTP->new("remotehost.name", Debug => 0);
$ftp->login("anonymous",'cstephen@xxx.com');
$ftp->cwd("/downloads");
$ftp->get("testfile.txt");
$ftp->quit;
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2001 01:17 PM
07-31-2001 01:17 PM
Re: ftp scripting,
The script ftp is included in a .ksh. After the ftp, we have a program which should test the result of the transfer: the contents of the source and the destination. But when there are problems during the transfer, the connection is closed but we have an ftp without connection (equivalent of ftp > prompt with closed connection). We have the errors in a file which we read in a while and as soon as we have an error, we want let us stop the session and manage the end of the program. To do it, it is necessary to us to have the PID of the process FTP to be able to kill the process. The ftp is constructed dynamically and looks like :
ftp -i -v -n server
toto contains the commands ftp like :
user username password
cd ...
get ...
...
bye
Suggestion ?
Nora
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2001 07:51 AM