I have a file on CentOS machine that needs to be copied to Windows NT server.
I use \10.10.10.10 to connect to the server from my windows desktop. I can copy the files using the GUI,
but I want to write a shell script on my centOS server that will periodically copy files to windows box.
Mount the Windows NT server on your CentOS machine:
Requires smbfs/cifs. From here on, it's just normal cp or rsync or whatever you want to do.
There is another option not mentioned here. You can use the
PuTTY
suite of tools, specificallypscp
to copy a file from the CentOS box to the Windows box. Getpscp
(google) and use the command prompt in the directory wherepscp
resides:pscp [email protected]:/path/to/file .
This will copy the file to the current directory.
You could map a share with samba from the windows server on your centos box. Then it is a normal cp command you have to do.
You can find the needed information in smbclient howto.
As it's an NT server I'm going to assume that this is in a closed environment where security isn't an overwhelming issue (if I'm wrong then why are you still using NT?).
If you don't have smbfs support on your CentOS machine, as suggested by your comment to Raffael's answer, you could enable the NT machine's FTP server and use scripted FTP commands to perform the file transfer.