- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to find out if the FTP file is finished lo...
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
11-12-2004 08:22 AM
11-12-2004 08:22 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2004 08:31 AM
11-12-2004 08:31 AM
Solution'fuser' is a good idea but it is not available for normal users.
If you are 'get'ting the file, then you will have to write the script after that session is completed.
If you are putting the file from somewhere, then the local 'ftpd' will be active on the system. You will see a string something like 'STOR
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2004 08:40 AM
11-12-2004 08:40 AM
Re: How to find out if the FTP file is finished loading
I would make use of Perl's Net::FTP module; the good news is that I already have a Perl script that you can simply call from the shell to do all the hard work.
Use it like this:
REMOTE_HOST=mickey
REMOTE_DIR=/u01/mydir
REMOTE_USER=cstephen
PASSWD=top_secret
RETRIES=3
ftpput.pl -h ${REMOTE_HOST} -l ${REMOTE_DIR} -p ${PASSWD} -d ${REMOTE_DIR} -t ${RETRIES} myfile1 myfile2 myfile3
STAT=${?}
In this case, if ${STAT} -eq 0 then myfile1, myfile2, myfile3 were sent sucessfully and you can now move them.
Invoke as ftpput.pl -u for full usage. Note that you can omit the passwd if it is specified in the user's .netrc file (just like FTP).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2004 08:41 AM
11-12-2004 08:41 AM
Re: How to find out if the FTP file is finished loading
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2004 09:27 AM
11-12-2004 09:27 AM
Re: How to find out if the FTP file is finished loading
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2004 10:23 AM
11-12-2004 10:23 AM
Re: How to find out if the FTP file is finished loading
#!/usr/bin/sh
REMOTE_HOST=mickey
REMOTE_DIR=/u01/mydir
REMOTE_USER=cstephen
PASSWD=top_secret
RETRIES=3
BIN_OR_ASCII="-A" # ASCII xfer
ftpget.pl -h ${REMOTE_HOST} -l ${REMOTE_DIR} -p ${PASSWD} -d ${REMOTE_DIR} -t ${RETRIES} ${BIN_OR_ASCII} myfile1
STAT=${?}
This will log you in on the remotehost, cd to the indicated directory, assert ASSCI mode, and try to get myfile up to 3 times before giving up. If ${STAT} is zero, you got all the file. Invoke as ftpget.pl for full usage. Again, the passwd can be read from the .netrc file if available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2004 10:26 AM
11-12-2004 10:26 AM
Re: How to find out if the FTP file is finished loading
That should have been "-l ${REMOTE_USER}" rather than "-l ${REMOTE_DIR}" in all cases above.
ftpget.pl -h ${REMOTE_HOST} -l ${REMOTE_USER} -p ${PASSWD} -d ${REMOTE_DIR} -t ${RETRIES} ${BIN_OR_ASCII} myfile1
STAT=${?}