- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Need help on writing a script to run ftp...
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
10-23-2000 10:09 PM
10-23-2000 10:09 PM
How do I run a script to ftp a site
and mget files? (assume that I am sure where
the files be). Something as below does not work.
ftp 192.168.0.1
username1
hispass
prompt
mget *.dat
bye
unquote *****
It stopped at the prompt for asking user name.
Thank you for your help.
Jessica
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2000 10:21 PM
10-23-2000 10:21 PM
Re: Need help on writing a script to run ftp...
Create a file called .netrc in the home directory of the user who gets the files.
set the permissions as 700 .
Add the following lines in this file:
*********************************
machine
login
password
prompt
mget *.dat
bye
******************************
Note: this file needs 1 blanck line after the bye statement.
After you make .netrc file, then enter:
# ftp 192.168.0.1
I hope this helps,
federico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2000 10:25 PM
10-23-2000 10:25 PM
Re: Need help on writing a script to run ftp...
you could do:
ftp -n <
user username1 hispass
prompt
mget *.dat
bye
EOF
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2000 10:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2000 05:10 AM
10-24-2000 05:10 AM
Re: Need help on writing a script to run ftp...
put the following in a script:
/usr/bin/ftp -vin <
user "username" "passwd" #without the qoutes
binary
#cd to directory if needed
#lcd to local directory if needed
mget *
quit
EOF
the -v is important, else the script will hang on a prompt y/n