- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- FTP script
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
07-26-2001 03:27 PM
07-26-2001 03:27 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2001 03:59 PM
07-26-2001 03:59 PM
Re: FTP script
Have a look at the man page on how to do it
man netrc
HTH
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2001 04:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2001 04:13 PM
07-26-2001 04:13 PM
Re: FTP script
Using the 'netrc' method has better security implicatations since you don't have to bury a password in a script. However, here's another way:
{
echo "open $HOST
user $WHO $WHOPASS
hash
$ACTION $LOCALFILE $REMOTEFILE
close"
} | ftp -i -n -v 2>&1 | tee -a $LOGFILE
...the $Variables should be self-explanatory. This snipet captures the ftp dialog into $LOGFILE. The "hash" shows the transfer progress.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2001 01:05 PM
07-27-2001 01:05 PM
Re: FTP script
the archoes must be full of answers for your question,
as I remember having answered quite some of them ;-)
Anyway, create or edit the file $HOME/.netrc and set
permissions to 600 or 400 - it will NOT work otherwise.
The content should be something like:
machine MARS user JOHN password SECRET macdef init
cd /DIR-ON-TARGET
lcd /DIR-ON_LOCAL-STATION
bin
prompt
mget FILE-PATTERN
quit
There must be an empty line after that paragraph.
All the UPPERCASE words must be replaced with your
own values, perhaps in lower-case... ;-)
Which means, you DO have a plain-text password in
that file on your local station! Hence the permissions!
Next time you (the userid with that $HOME directory)
start "ftp" to that target-station, it will NOT ask for
username nor password, but use those from the ".netrc".
Then it will change the directories, remote and locally,
set transfermode to binary, turn off the prompt for Y/N
for each file, and transfer all the files matching that
pattern from remote to local station, and quit.
If you want ASCII-conversion, use "ascii" instead of
"bin", if you want transfer from local to remote use
"mput" instead of "mget" (read: multiple get/put).
HTH,
Wodisch