- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Look for a script upload .txt files from remote si...
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
02-02-2004 06:44 PM
02-02-2004 06:44 PM
Look for a script upload .txt files from remote sites (PC) to a rp5470 server
Could you tell me how to write a unix script which upload .txt files from remote sites (PC workstation) to a directory at rp5470 server?
Thanks very much!
Best Regards
Ajk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 06:49 PM
02-02-2004 06:49 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
Whitout this info, it is not easy to write a script that will work for you.
Regards,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 07:01 PM
02-02-2004 07:01 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
snarf is good for downloads. I Think it can be used for scripted uploads as well.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 07:13 PM
02-02-2004 07:13 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
#######################
#Start Ftp and get file#
########################
ftp -nv ${SERVER} << FTPEOF > /tmp/temp_log.$$
user ${USERNAME} ${PASSWORD}
#Get file
get $1
quit
FTPEOF
put works just fine too.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 07:22 PM
02-02-2004 07:22 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
for IP in 'list_of_IPs_separated_by_space'
do
ftp -n -v >> 'ftp.log' 2>> 'ftp.log' <
user username password
cd remote_directory
prompt
mget *.txt
quit
EOF
done
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 07:51 PM
02-02-2004 07:51 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
Those PC workstations will be W2K. Can I not use userid and password in the script to upload files to the unix server? Also, I use DHCP assign IP to the PC workstations. Is it possible to use the PCs' Host Name instead in the script? How can I do that? Thank you!
Best Regards
Ajk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 08:15 PM
02-02-2004 08:15 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
Try this,
for HOST in 'list_of_hostnames_separated_by_space'
do
ftp -n -v >> 'ftp.log' 2>> 'ftp.log' <
user username password
cd remote_directory
prompt
mget *.txt
quit
EOF
done
Why do you need to use User ID / password? Instead use the username and password. Is the username is same across all the NT hosts?? If it is different then you will have problem with this script.
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 08:27 PM
02-02-2004 08:27 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
sshd server for Wins. Its possible
to start the connection from unix without the passwd, to do so you have to generate & deploy the sshkey pairs. I experienced with on W2K and WXP sucesfully (hint: UsePrivilegeSeparation no). However, from some reason I don't know the passwordless login (key based autentification) didn't work on Win2003 server. According to docs it should work, but I didn't figure out the solution even after hours of googling. But W2K and XP no problem. Best regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 08:42 PM
02-02-2004 08:42 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
I am kind of confusing... From your script, the username and password is "root" in unix users? So I don't need to care the username and password at the PC workstation?? Would you explain it, please? Thank you very much.
Best Regards
Ajk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 09:11 PM
02-02-2004 09:11 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
Well let me put it this way,
What you need is to download some *.txt file from remote Windows PCs running ftp to a directory in your rp5470 server right?. So first login to the RP5470 server using some user name / password (root user in your case. May be you can create a directory using,
mkdir /textfiles
cd /textfiles
vi myscript
(copy and paste the script that I have posted. Change the following line,
user username password
to
user username_of_the_windows_PC password_of the_windows_PC
and finally save the file )
chmod +x myscript
./myscript
I hope the things are clear now ...
-Karthik S S
(Here I assume that the username/password are same for all the windows PCs).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2004 12:54 AM
02-03-2004 12:54 AM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=B8725AA
Create a share on your HP-UX box, and map a drive from your W2K clients to it. Then from the W2K boxes, save the .txt files to that share. You could even create a simple bat job on the W2K boxes to copy or move the files if you like - better to just place them in the share from the start...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2004 12:41 PM
02-04-2004 12:41 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
I did follow your steps creating the script, but it was not working. When I look at the ftp.log, it shows:
ftp: cpu1212: Unknown host
Not connected.
Not connected.
Interactive mode off.
Did I do something wrong? Thanks.
Best Regards
Ajk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2004 12:57 PM
02-04-2004 12:57 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
for HOST in 'cpu1212'
do
ftp -n -v >> 'ftp.log' 2>> 'ftp.log' <
user isajk xxx
cd \test
prompt
mget *.txt
quit
EOF
done
Best Regards
Ajk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 12:12 PM
02-08-2004 12:12 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
Could you help me to solve the problem, please? Thanks a lot!
Best Regards
Ajk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 06:46 PM
02-08-2004 06:46 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
Then it should be like this:
for HOST in 'cat /path-to-file/cpu1212'
do
ftp -n -v >> 'ftp.log' 2>> 'ftp.log' <
user isajk xxx
cd \test
prompt
mget *.txt
quit
EOF
done
The hosts in the file, must be resolvebale by the system. (check before starting the script with ping or nslookup)
Regards,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 07:42 PM
02-08-2004 07:42 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
My script is shown as the following:
for HOST in 'cat /home/hostfile'
do
ftp -n -v >> 'ftp.log' 2>> 'ftp.log' <
user isajk xxxxxx
cd \test
prompt
mget *.txt
quit
EOF
done
And the hostfile contains the host name 'cpu1212' only.
When I run the script, nothing happens and I see the ftp.log:
cat: bad port number-- /home/hostfile
usage: open host-name [port]
Not connected.
Not connected.
Interactive mode off.
Not connected.
What should I do?? Any help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 07:57 PM
02-08-2004 07:57 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
for HOST in `at /home/hostfile`
Then it should work.
Regards,
Peter
Sorry that I missed this one in the previous post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 07:58 PM
02-08-2004 07:58 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
for HOST in `cat /home/hostfile`
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 08:52 PM
02-08-2004 08:52 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
I just feel frustrated as the ftp.log is shown:
ftp: connect: Connection refused
Not connected.
Not connected.
Interactive mode off.
Not connected.
Did I do something wrong??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 09:28 PM
02-08-2004 09:28 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
This should result in the same error.
Is the FTP deamon running on the remote host where FTP is trying to connect?
Regards,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2004 12:35 PM
02-09-2004 12:35 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
I did type the username and password for PC workstation in the script correctly. Actually, the server is at the remote site now, not in my office. Also, the PC workstation will be at ANOTHER remote site. What should I do in this case? Thanks very much.
Best Regards
Ajk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2004 04:52 PM
02-09-2004 04:52 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
Because you get a connection refused, it most of the times when there is no FTP server running.
First test it manual, if thats working your script will be able to do the same trick for you.
Regards,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2004 05:29 PM
02-09-2004 05:29 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
check whether you can do a ftp from the command line without using the script.
Also do attach the contents of hostfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2004 09:31 PM
02-09-2004 09:31 PM
Re: Look for a script upload .txt files from remote sites (PC) to a rp5470 server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2004 09:32 PM
02-09-2004 09:32 PM