- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: FTP of one file - Struggling
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-27-2004 06:10 PM
07-27-2004 06:10 PM
I need to ftp a file to a host that uses an username and password. Is there any way I can copy this file , for example with rcp , to the host or can anyone help with a script that can do this ?
Thanks !
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2004 06:20 PM
07-27-2004 06:20 PM
Re: FTP of one file - Struggling
Exactly what problem do you encounter?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2004 06:50 PM
07-27-2004 06:50 PM
Re: FTP of one file - Struggling
I'm not clear about your problem
Regards
Rainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2004 06:59 PM
07-27-2004 06:59 PM
Re: FTP of one file - Struggling
Just to make it a bit clearer. I can use ftp , no problem at all , but I want to automate it , it's gonna run every 2 hours every day. How do I get past the username and password issue ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2004 07:42 PM
07-27-2004 07:42 PM
Re: FTP of one file - Struggling
so of course you could use rcp for this task.
you have to set up a hosts.equiv file on the target machine with entry:
Regards
rainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2004 07:44 PM
07-27-2004 07:44 PM
Re: FTP of one file - Struggling
if it is a big file, you should consider using rsync which will only transmit the differences of both files
Regards
Rainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2004 08:26 PM
07-28-2004 08:26 PM
Solutionftp -n -v -i host 2> /dev/null 1> /var/tmp/ftp.log << !
user ftpuser ftppassword
cd /tmp
put file.txt
bye
!
But I guess that the rsync option may be a better bet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2004 08:40 PM
07-28-2004 08:40 PM
Re: FTP of one file - Struggling
for automatic ftp you can use folowing script launched by cron
23 59 * * * /usr/bin/ftp /usr/bin/ftp -i -n -v < mybackup.sh
cat mybackup.sh
open 10.32.113.177 # destination
user ford abcd #abcd is password
hash
prompt off
cd /dir
mput file_you_want_to_backup
bye
at midnight you have your backup in /dir
br Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2004 08:40 PM
07-28-2004 08:40 PM
Re: FTP of one file - Struggling
To use rcp set .rhosts file in $HOME directory on two servers.
rcp
To do it for two hours, use crontab to it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2004 09:24 PM
07-28-2004 09:24 PM
Re: FTP of one file - Struggling
rcp its always a secure way than ftp because you never write the password.
In your target $HOME user's directory (suppose userB1 into serverB box) set a .rhosts file:
Where:
i.e:
serverA userA1
From serverA and userA1 $HOME dir:
/usr/bin/rcp
This must be successful. Then, to automate this proccess each two hours set userA1 cronfile (crontab -e) with the following schedule:
00 0,2,4,6,8,10,12,14,16,18,20,22 * * * /usr/bin/rcp
Remember allow cron execution for userA1 include it into /var/adm/cron/cron.allow file.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2004 12:51 AM
07-29-2004 12:51 AM
Re: FTP of one file - Struggling
#!/usr/bin/expect
spawn ftp
expect "Name"
send "user\r"
expect "Password:"
send "password\r"
expect "ftp> "
send "lcd /home/xfer\r"
expect "ftp> "
send "cd /tmp/xfer\r"
expect "ftp> "
send "mput *\r"
expect "ftp> "
send "quit\r"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2004 01:27 AM
07-29-2004 01:27 AM
Re: FTP of one file - Struggling
man netrc
.netrc file allows HP-UX FTP command to do automated login to another host.
Follow all security suggestions.
HTH,
-> Brian Hackley