- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ftp successfull confirmation
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
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
тАО09-07-2006 06:51 AM
тАО09-07-2006 06:51 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2006 06:54 AM
тАО09-07-2006 06:54 AM
Re: ftp successfull confirmation
you may use
ls -l
in ftp session to check the file size.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2006 06:58 AM
тАО09-07-2006 06:58 AM
SolutionIt might be useful to do an md5sum checksum on the file both before and after to make sure the whole file got there unadulterated.
Further, if you use scripted ftp to put the file you can check the return code of the send process.
After any commmand in a script the variable $? contains the return code. echo $?
If you get a zero, the transmission was successful.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2006 07:24 AM
тАО09-07-2006 07:24 AM
Re: ftp successfull confirmation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2006 07:35 AM
тАО09-07-2006 07:35 AM
Re: ftp successfull confirmation
Using any form of checksum or comparing the number of characters in the file on the source and destination servers is *not* guaranteed to yield an indication of a successful transfer.
Consider ASCII file transfers from/to UNIX and Windows platforms where carriage-returns are added or subtracted from linefeed record delimiters!
The 'ftpd' daemon offers a three-digit reply message that you can decode. See the manpages for 'ftpd(1M)' for more information. This, together with the message text it contains offer your salvation.
For instance, if I capture the '-v'erbose output of a transfer session into a logfile and parse that file at the end of the FTP session, I can find a successful transfer if I see something like:
226 transfer complete
The *exact* message will differ slightly for different FTP implementations, though.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2006 07:45 AM
тАО09-07-2006 07:45 AM
Re: ftp successfull confirmation
md5sum is not a command per-se. md5 is an algorithm, a complex one at that, to calculate the checksum of a given file. Calculation returns a unique string of characters for each individual file.
md5 application can be obtained from
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/md5-1.00/
the down side of md5, it needs to be on both ends of the ftp connection and you need to be able to run it on the remote system and be able to see the output string. If you are not the administrator of the target system, you may have a problem.
There is a product called NDM (network data mover), sole purpose of which is to verify that data transmitted from one system to the other completes successfully and if not, depending on your configuration of this application, it may retry certain number of times more and notifies you of the failures. Product is now called connect:direct and sold by sterling commerce. Brief FAQ about this product can be found here:
http://www.proginetuk.co.uk/sections/faqs/126.htm
in the lack of ndm and admin capabilities on the target node, what you are doing is the only guaranteed way of verifying your data transfer was successful.
hope this helps.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2006 12:29 PM
тАО09-07-2006 12:29 PM
Re: ftp successfull confirmation
The attached Perl script, ftpput.pl, will do all the stuff for you and all your shell script has to do is see if the exit status = 0; if so, all was well. It will even retry files automatically and not return a bad exit status until the specified number of retries are done. It will exit upon the first failed file.
#!/usr/bin/sh
typeset -i STAT=0
ftpput.pl -h remhost -l mickey -p secret -B -d /aaa/bbb/ccc myfile1 myfile2 myfile3
STAT=${?}
if [[ ${STAT} -eq 0 ]]
then
echo "Okey Dokey"
else
echo "BAD FTP; status ${STAT}." >&2
fi
exit ${STAT}
------------------------------------------
This will login to remhost as user "mickey", password "secret", assert BINARY (-B) transfer mode, (-A would assert ASCII), cd to /aaa/bbb/ccc on remhost, and finally put myfile1, myfile2, and myfile3.
If any of the requests (e.g. cd -d /aaa/bbb/ccc) fail or the puts of the files fail then a non-zero exit status is returned. You don't have to pass the password on the command line because just like a real FTP client, it will read a .netrc file.
Invoke as ftpput.pl -u for full usage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2006 12:31 PM
тАО09-07-2006 12:31 PM
Re: ftp successfull confirmation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2006 06:58 PM
тАО09-07-2006 06:58 PM
Re: ftp successfull confirmation
typeset -i STAT=0
open astmachine
user REmbraceFTP Password1
type ascii
cd /FTPRemedy/Embrace/Inbox
lcd /usr1/EMBRACE/EMBRACE.AST/TRANSFERS
mput LMTEST
STAT=${?}
if [[${STAT} -eq 0 ]]
then
echo "Okay"
else
echo "BAD FTP; status ${STAT}." >&2
fi
exit ${STAT}
quit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2006 07:11 PM
тАО09-07-2006 07:11 PM
Re: ftp successfull confirmation
230 User REmbraceFTP logged in.
Remote system type is Windows_NT.
ftp> type ascii
200 Type set to A.
ftp> cd /FTPRemedy/Embrace/Inbox
250 CWD command successful.
ftp> lcd /usr1/EMBRACE/EMBRACE.AST/TRANSFERS
Local directory now /usr1/EMBRACE/EMBRACE.AST/TRANSFERS
ftp> mput LMTEST
mput LMTEST? y
200 PORT command successful.
150 Opening ASCII mode data connection for LMTEST.
226 Transfer complete.
18 bytes sent in 0.00 seconds (390.62 Kbytes/s)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2006 01:55 AM
тАО09-08-2006 01:55 AM
Re: ftp successfull confirmation
you have to sue a here_document way:
ftp -inv <
open astmachine
user REmbraceFTP Password1
type ascii
cd /FTPRemedy/Embrace/Inbox
lcd /usr1/EMBRACE/EMBRACE.AST/TRANSFERS
mput LMTEST A
quit
END_OF_FTP
in this way you will hav ein ftp.log all the outputs.
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-08-2006 02:30 AM
тАО09-08-2006 02:30 AM
Re: ftp successfull confirmation
lcd /usr1/EMBRACE/EMBRACE.AST/TRANSFERS
mput LMTEST
STAT=${?}
Is there something wrong with my syntax?
------------------------------------------
Is the Pope catholic?
More importantly, there is something wrong with your logic. You are mixing ftp and shell commands and expecting meaningful result. The ftp client in verbose mode will send a 3 digit result code after each but ftp command but trying to test this with ${?} is Looney Tunes. The ftp process has not terminated so there is no exit status with respect to ftp. You should also note that for most of the ftp commands, if the first digit of the 3 digit status is '2' then all is well.
Save yourself some trouble and use the ftpput.pl Perl script then ALL you have to do is simply examine the exit status of that command and if it is zero then all went well. It does all the tedious error checking for you.