- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Need help moving from ftp to scp
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
тАО07-15-2010 11:14 AM
тАО07-15-2010 11:14 AM
Need help moving from ftp to scp
After the keys are established, would I be able to simply replace the ftp in the commands with scp?
Also will the error checking greps still work?
I have attached an example script which was generated & run by a batch program.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2010 11:45 AM
тАО07-15-2010 11:45 AM
Re: Need help moving from ftp to scp
Your 'scp' will return zero for success and non-zero for failure. You can test this.
You could also redirect any STDERR to a file which you could parse for more specific failure analysis:
# scp -p srcfile desthost:destfile 2>/var/tmp/scp.$$
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2010 11:52 AM
тАО07-15-2010 11:52 AM
Re: Need help moving from ftp to scp
ftp -i -v pla_img_prod >/app/pro1/if/image_retrieval/image_retrieval_work_out/if280ftp20080918092427.0001.log 2>&1 << !
binary
get "lolcb\LC6569\ky8246020059e644.pdf" /app/pro1/if/image_retrieval/image_retrieval_work_in/ky8246020059e644.pdf
! echo GETTING FILE 1 ky8246020059e644.pdf
quit
!
if egrep -i "Connection timed out" /app/pro1/if/image_retrieval/image_retrieval_work_out/if280ftp20080918092427.0001.log 1>/dev/null 2>&1
then exit 1
elif egrep -i "Not connected" /app/pro1/if/image_retrieval/image_retrieval_work_out/if280ftp20080918092427.0001.log 1>/dev/null 2>&1
then exit 2
elif egrep -i "aborted" /app/pro1/if/image_retrieval/image_retrieval_work_out/if280ftp20080918092427.0001.log 1>/dev/null 2>&1
then exit 3
elif egrep -i "error" /app/pro1/if/image_retrieval/image_retrieval_work_out/if280ftp20080918092427.0001.log 1>/dev/null 2>&1
then exit 4
elif egrep -i "Login failed" /app/pro1/if/image_retrieval/image_retrieval_work_out/if280ftp20080918092427.0001.log 1>/dev/null 2>&1
then exit 6
fi
file_cnt=`egrep -ci "GETTING" /app/pro1/if/image_retrieval/image_retrieval_work_out/if280ftp20080918092427.0001.log`
trans_cnt=`egrep -ci "226 TRANSFER COMPLETE" /app/pro1/if/image_retrieval/image_retrieval_work_out/if280ftp20080918092427.0001.log`
if [ $file_cnt -eq $trans_cnt ]
then exit 0
elif [ $file_cnt -ne $trans_cnt ]
then exit 5
fi
And a example of the file which is greped for errors:
Connected to usplswebh04a.
220 usplswebh04a Microsoft FTP Service (Version 5.0).
331 Password required for lcftp001.
230 User lcftp001 logged in.
Remote system type is Windows_NT.
200 Type set to I.
200 PORT command successful.
150 Opening BINARY mode data connection for lolcb\LC6569\ky8246020059e644.pdf(44685 bytes).
226 Transfer complete.
GETTING FILE 1 ky8246020059e644.pdf
44685 bytes received in 1.57 seconds (27.75 Kbytes/s)
200 PORT command successful.
150 Opening BINARY mode data connection for lolcb\LC6064\ky7904800059ecf7.pdf(46878 bytes).
226 Transfer complete.
GETTING FILE 2 ky7904800059ecf7.pdf
46878 bytes received in 7.99 seconds (5.73 Kbytes/s)
200 PORT command successful.
150 Opening BINARY mode data connection for lolcb\LC7074\ky8626190059ecf6.pdf(49003 bytes).
226 Transfer complete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2010 12:13 PM
тАО07-15-2010 12:13 PM
Re: Need help moving from ftp to scp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2010 12:22 PM
тАО07-15-2010 12:22 PM
Re: Need help moving from ftp to scp
Try this:
http://www.hpux.ws/?p=10
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com