- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- File transfer from unix to windows
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
01-24-2006 02:31 AM
01-24-2006 02:31 AM
File transfer from unix to windows
Michelle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 02:39 AM
01-24-2006 02:39 AM
Re: File transfer from unix to windows
Put an ftp script in your crontab
This is an example of a script
ftp -nv hostname << EOF
user username password
bin
cd c:\temp
put /unixfile windowsfile
quit
EOF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 02:45 AM
01-24-2006 02:45 AM
Re: File transfer from unix to windows
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 02:53 AM
01-24-2006 02:53 AM
Re: File transfer from unix to windows
I must confess though, I'm not sure how to create an sftp server on a Windows box (but I'd probably start by trying the free Cygwin tools). After that it's just an issue of standard setup of ssh keys. Cygwin for Windows can do that too.
Or... you could create a share point on a Windows server and use the CIFS client(Samba) to mount it onto the Unix box.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 02:57 AM
01-24-2006 02:57 AM
Re: File transfer from unix to windows
If you don't want to embed a user and password in your FTP scripts, use a '$HOME/.netrc' file. See the manpages for 'netrc(4)' for more information.
Also, remember that if you are transfering an ASCII file from a UNIX to WINDOWS server, you need to force the translation of the UNIX newline to the Windows linefeed_carriage-return couplet. This is automatically done by FTP if you specify ASCII mode for the transfer.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 02:58 AM
01-24-2006 02:58 AM
Re: File transfer from unix to windows
Perhaps you can find here something:
http://www.microsoft.com/windowsserversystem/sfu/default.mspx
check this for ftp "without" loggin:
http://www.informatik.uni-frankfurt.de/doc/man/hpux/netrc.4.html
otherwise you can use samba or nfs
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 07:54 PM
01-24-2006 07:54 PM
Re: File transfer from unix to windows
you could use the .netrc file in your directory to store all the windowd login in a file only, otherwise configure a windows frp anaonymous account.
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 07:58 PM
01-24-2006 07:58 PM
Re: File transfer from unix to windows
1) .netrc file.
Create .netrc file with contents as,
Example:
The following is a valid entry for the host hpxdzg whose guest account
has the password sesame:
machine hpxdzg login guest password sesame
create the file in $HOME directory of the user which will transfer files.
2) Using ftp non-interactive method.
ftp -in
user username passwd
commands
bye
EOF
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 08:00 PM
01-24-2006 08:00 PM
Re: File transfer from unix to windows
ftp -in host <<-EOF
user username password
bin
..
..
..
bye
EOF
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2006 08:54 PM
01-24-2006 08:54 PM
Re: File transfer from unix to windows
Have you considered using CIFS? You would need to share a drive from your Windows servers which would be mounted on the HP-UX server, then it would just be a case of copying files across as required.
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2006 01:05 AM
01-25-2006 01:05 AM
Re: File transfer from unix to windows
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2006 01:13 AM
01-25-2006 01:13 AM
Re: File transfer from unix to windows
I'd suggest reading through the latest CIFS client guide to find out more how it could be integrated into your environment.
best regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2006 10:42 PM
02-01-2006 10:42 PM
Re: File transfer from unix to windows
Fred Mallett
A very common stumbling block people run into occurs when they try to have a script (or cron job) perform an ftp.
It would seem that something like:
ftp somehost <
mypassword
put somefile
bye
EOF
Would work, but due to stream handling on the part of ftp, it does not read from the document (or even an input redirected file), so you get prompted for the password, and the non-interactive session does not occur.
A fairly complex, but very powerful solution would be to learn the Expect language, and write some code in Perl or TCL, or some language that can include Expect. This is a good solution for dynamic situations.
If you want a quick and dirty (and less powerful) solution try using the .netrc file. IT is a reasonable thing to do when high security is not an issue (such as ftp's within a network, or a daily anonymous ftp get).
Here is the flow:
When ftp is invoked without the -n option, an autologin is attempted. Autologin occurs if:
â ¢ There is a .netrc file in the users home directory.
â ¢ That file is owned by the user running ftp
â ¢ The file has rights of 00 for group and others, with read rights for the owner (such as 600).
â ¢ There is a "machine" entry that matches the server argument on the command line.
For example, if you executed:
ftp host1
And you had a .netrc file with the following:
machine host1 login myaccount password mypassword
You would be automatically logged into host1. Normal prompting would occur for any other hostname (or IP address). Another allowed keyword is default, which you could use for various unlisted sites that allow anonymous logins.
Putting this together into the scripting scenario mentioned above, the following would now work in a shell script:
ftp host1 <
get somefile
bye
EOF
If you wanted to do an mget or mput, you could either use the -i option to ftp, or include the "prompt off" ftp command as seen in the Perl snippet below:
open(FTP, "|ftp host1>/dev/null");
print(FTP "prompt offn");
print(FTP "cd somedirn");
print(FTP "put somefilen");
print(FTP "byen");
close(FTP);
if ($?==0){
#do some success thing
} else {
#do some unsuccessful thing (log or email?)
}
Good Luck,