HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Where can I find an FTP script to automate
Operating System - HP-UX
1827876
Members
1259
Online
109969
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
Forums
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
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
01-28-2002 09:58 AM
01-28-2002 09:58 AM
I am in a situation where many users FTP into our HP/UX 10.20 K570 for downloads. I am worried and have security issues with this access, but realize that these users need access to data. I on the other hand do not want to add this task on to my job description.
I have just set up an FTP server on an NT 4.0 server, and I can now manually FTP from my HP to the NT Server. I have written simple scripts before, but am in no way an expert. I tried to write a script that will FTP about 180 files onto the NT FTP server. It connects to the server, but does not go further.
The Script Connected to 10.xxx.xxx.xxx.
220 Serv-U FTP Server v3.1 for WinSock ready...
Name (10.xxx.xxx.xxx:root):
Where can I find a similar script that I can use as a templete?
I have just set up an FTP server on an NT 4.0 server, and I can now manually FTP from my HP to the NT Server. I have written simple scripts before, but am in no way an expert. I tried to write a script that will FTP about 180 files onto the NT FTP server. It connects to the server, but does not go further.
The Script Connected to 10.xxx.xxx.xxx.
220 Serv-U FTP Server v3.1 for WinSock ready...
Name (10.xxx.xxx.xxx:root):
Where can I find a similar script that I can use as a templete?
Do not worry about where you are at in your life right now, as long as you moved a little in the right direction from yesterday to today, and am moving in the right direction today for tomorrow.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2002 10:12 AM
01-28-2002 10:12 AM
Solution
This thread give you exactly what you need and more .
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x74e49200caded5118ff40090279cd0f9,00.html
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x74e49200caded5118ff40090279cd0f9,00.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2002 10:15 AM
01-28-2002 10:15 AM
Re: Where can I find an FTP script to automate
John,
Please see the attached script for an example of a script that will accomplish what you're after. Basically you can call this script from another script and pass it the following information:
Usage: ftp_batch hostname userid passwd get|put src_file dest_file
So if you have mutiple files that you need to transfer you can either copy the script into your existing script or just loop with the list of files to transfer and call this script each tiem in that loop. If you need more examples just reply back here, but this should help with the FTP portion.
In case the script doesn't attach properly, here is the full thing:
if [ $# -ne 6 ]
then
echo "Usage: ftp_batch hostname userid passwd get|put src_file dest_file"
exit 1
else
{
ftp -v -n < open $1
user $2 $3 0
$4 $5 $6
EOF
} |grep -e "226 Closing" -e "226 Transfer complete." -e "226 ASCII Transfer complete."> /dev/null
error_code=$?
if [ $error_code -eq 0 ]
then
echo "FTP: $4 $5 $6 on host $1 for $2"
else
echo "FTP error: $4 $5 $6 on host $1 for $2"
fi
exit $error_code
fi
Hope that helps.
-Mike
Please see the attached script for an example of a script that will accomplish what you're after. Basically you can call this script from another script and pass it the following information:
Usage: ftp_batch hostname userid passwd get|put src_file dest_file
So if you have mutiple files that you need to transfer you can either copy the script into your existing script or just loop with the list of files to transfer and call this script each tiem in that loop. If you need more examples just reply back here, but this should help with the FTP portion.
In case the script doesn't attach properly, here is the full thing:
if [ $# -ne 6 ]
then
echo "Usage: ftp_batch hostname userid passwd get|put src_file dest_file"
exit 1
else
{
ftp -v -n <
user $2 $3 0
$4 $5 $6
EOF
} |grep -e "226 Closing" -e "226 Transfer complete." -e "226 ASCII Transfer complete."> /dev/null
error_code=$?
if [ $error_code -eq 0 ]
then
echo "FTP: $4 $5 $6 on host $1 for $2"
else
echo "FTP error: $4 $5 $6 on host $1 for $2"
fi
exit $error_code
fi
Hope that helps.
-Mike
The network is the computer, yeah I stole it from Sun, so what?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2002 11:25 AM
01-28-2002 11:25 AM
Re: Where can I find an FTP script to automate
Thanks guys this worked out great. The 1st line is what I had missing. It downloaded my test perfectly. There are other of you script that looks like it may make my scripts even better. Thank you for the lesson :)
Do not worry about where you are at in your life right now, as long as you moved a little in the right direction from yesterday to today, and am moving in the right direction today for tomorrow.
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.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP