- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ftp command
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
11-13-2002 05:56 AM
11-13-2002 05:56 AM
ftp command
I need to ftp a file from one UNIX box to other UNIX box without humman intervation. I do not need the second box to ask for a user name and password.
Help.
Augusto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2002 05:59 AM
11-13-2002 05:59 AM
Re: ftp command
If the latter then the trick is to run ftp with the -n flag to disable auto-login. You can then supply the user command (with the password) as part of your command stream.
I suggest that you use the forums search facility for more information, this is a popular subject.
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2002 06:11 AM
11-13-2002 06:11 AM
Re: ftp command
The rcp command might be a good option.
If the username and password are the same on
both systems, rcp should do the job without having to enter a password.
Eileen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2002 06:19 AM
11-13-2002 06:19 AM
Re: ftp command
Do a man on .netrc
This may be what you are looking for.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2002 07:08 AM
11-13-2002 07:08 AM
Re: ftp command
machine machine_name_you_want_to_ftp_to
login your_login_name
password password_on_target
then be sure that the file is only readable by you. If .netrc is readable by anyone else it is ignored:
chmod 400 .netrc
Then create a shell script to do the transfer unattended:
#!/usr/sbin/sh
ftp -v machine_name > ftp.log << -EOF
asc
put file_name_to_transfer
quit
EOF
chmod it so it executes.
The -v option tells ftp to work verbose so it will actually put something in ftp.log for you to check status or have it mailed to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2002 07:40 AM
11-13-2002 07:40 AM
Re: ftp command
Do something like this:
ftp.pl myfile1 myfile2
STAT=${?}
if [[ ${STAT} -eq 0 ]]
then
echo "FTP ok"
else
echo "FTP failed"
fi
If the exit status of ftp.pl = 0 then myfile1 and myfile2 were sucessfully transferred. The login can be embedded withing the login command of the script or you can simply supply the login and .netrc will be read for the passwd.
You can download the Net::FTP module from www.perl.com/CPAN.
I never script these transfers in the shell anymore; Perl does it so much cleaner.