- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to get ftp logged if transmission fails
Operating System - HP-UX
1752754
Members
4583
Online
108789
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
10-03-2007 02:16 AM
10-03-2007 02:16 AM
The files that we want to monitor are sent by one server to other. These files are saved to an NFS mount directory.
Is it possible to log receiving transmission? If transmission fails how to get it logged?
Is it possible to log receiving transmission? If transmission fails how to get it logged?
Solved! Go to Solution.
- Tags:
- ftp
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2007 02:31 AM
10-03-2007 02:31 AM
Solution
Your question is somewhat confusing in that you mention ftp in the title but NFS in the body. If I can assume that you really meant FTP then it's not very difficult. You can use Perl's Net::FTP module and get error checking for free.
The attached Perl script will do all the hard work for you. All you have to do is a little shell scripting.
#!/usr/bin/sh
typeset FILENAME=myfile
typeset ERRLOG=/var/tmp/ftperrs
typeset -i STAT=0
ftpput.pl -h remhost -l mickey -p secret -B -d /aaa/bbb -t 3 ${FILENAME}
STAT=${?}
if [[ ${STAT} -ne 0 ]]
then
echo "Transfer of ${FILENAME} failed; status ${STAT}." >> ${ERRLOG}
fi
exit ${STAT}
That would login to remhost as user mickey, password "secret", set binary mode, cd to /aaa/bbb and transfer "myfile". It would automatically retry up to 3 times. If the command returns 0 all is well otherwise log the error. Just like real ftp, you can create a .netrc entry so that the password does not have to be used. Invoke as ftpput.pl -h for full usage.
The attached Perl script will do all the hard work for you. All you have to do is a little shell scripting.
#!/usr/bin/sh
typeset FILENAME=myfile
typeset ERRLOG=/var/tmp/ftperrs
typeset -i STAT=0
ftpput.pl -h remhost -l mickey -p secret -B -d /aaa/bbb -t 3 ${FILENAME}
STAT=${?}
if [[ ${STAT} -ne 0 ]]
then
echo "Transfer of ${FILENAME} failed; status ${STAT}." >> ${ERRLOG}
fi
exit ${STAT}
That would login to remhost as user mickey, password "secret", set binary mode, cd to /aaa/bbb and transfer "myfile". It would automatically retry up to 3 times. If the command returns 0 all is well otherwise log the error. Just like real ftp, you can create a .netrc entry so that the password does not have to be used. Invoke as ftpput.pl -h for full usage.
If it ain't broke, I can fix that.
- Tags:
- Perl
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP