- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Having FTP automatically executed
Operating System - HP-UX
1777111
Members
3182
Online
109065
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
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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
тАО12-18-1999 06:23 AM
тАО12-18-1999 06:23 AM
Having FTP automatically executed
Hello,
I'm a really green newbie in HP-UX, searching
for a simple way of having a list of commands
automatically executed in FTP. Is there a way
of doing it? Can a "batch" file be passed as
an argument to the FTP command?
Thankful for any help,
Rachid.
I'm a really green newbie in HP-UX, searching
for a simple way of having a list of commands
automatically executed in FTP. Is there a way
of doing it? Can a "batch" file be passed as
an argument to the FTP command?
Thankful for any help,
Rachid.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-1999 01:30 PM
тАО12-19-1999 01:30 PM
Re: Having FTP automatically executed
You can use a "HERE" script somthing like this to automate ftp transactions.
#!/bin/sh
SOURCE=$1
ftp -n $SOURCE < ascii
user username password
lcd
get /tmp/crap
EndFTP
#!/bin/sh
SOURCE=$1
ftp -n $SOURCE <
user username password
lcd
get /tmp/crap
EndFTP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-1999 11:15 PM
тАО12-19-1999 11:15 PM
Re: Having FTP automatically executed
This type of stdin redirection will work to automate your ftp session.
However, I recommend that you never place a user name and password in a flat
file like this. You can automate an ftp login by editing the .netrc file in
the appropriate user's home directory.
Use "man netrc" for details.
However, I recommend that you never place a user name and password in a flat
file like this. You can automate an ftp login by editing the .netrc file in
the appropriate user's home directory.
Use "man netrc" for details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-20-1999 02:48 AM
тАО12-20-1999 02:48 AM
Re: Having FTP automatically executed
After you set up your .netrc file (see netrc manpage and remember to chmod 400
.netrc) put some lines something like this in a shell script:
#!/bin/ksh
# Initialize some variables
SOURCE_DIR=your_source_dir_name
TARGET_DIR=your_target_dir_name
TARGET_MACHINE=your_target_machine_name
DATA_FILE=your_data_file_name
# Build ftp command file
echo "bin" > ${HOME}/.commands
echo "hash" >> ${HOME}/.commands
echo "prompt" >> ${HOME}/.commands
echo "cd " ${SOURCE_DIR} >> ${HOME}/.commands
echo "lcd " ${TARGET_DIR} >> ${HOME}/.commands
echo "put " ${DATA_FILE} >> ${HOME}/.commands
echo "quit" >> ${HOME}/.commands
# Do the ftp and log the output
cat ${HOME}/.commands | ftp ${TARGET_MACHINE} > \ /tmp/ftp_log
exit 0
Make the file executable and run it from cron and you're done.
.netrc) put some lines something like this in a shell script:
#!/bin/ksh
# Initialize some variables
SOURCE_DIR=your_source_dir_name
TARGET_DIR=your_target_dir_name
TARGET_MACHINE=your_target_machine_name
DATA_FILE=your_data_file_name
# Build ftp command file
echo "bin" > ${HOME}/.commands
echo "hash" >> ${HOME}/.commands
echo "prompt" >> ${HOME}/.commands
echo "cd " ${SOURCE_DIR} >> ${HOME}/.commands
echo "lcd " ${TARGET_DIR} >> ${HOME}/.commands
echo "put " ${DATA_FILE} >> ${HOME}/.commands
echo "quit" >> ${HOME}/.commands
# Do the ftp and log the output
cat ${HOME}/.commands | ftp ${TARGET_MACHINE} > \ /tmp/ftp_log
exit 0
Make the file executable and run it from cron and you're done.
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