Copy file from UNIX to WINDOWS shared folder

I need to create a script in UNIX that will copy a file from a UNIX directory to a WINDOWS shared folder.

The file myFile.txt is located in /unixServer/fileout/ and I need this file to be copied to a WINDOWS server /winServer/filein/.

Not sure where to start to create this script file for UNIX in order to do this.
Lee R Liddick JrReporting AnalystAsked:
Who is Participating?
arnoldConnect With a Mentor Commented:
Does your unix system access the share to which you want the data copied.

The suggestion farzanj is making presumes such access already exists.

If your unix has samba share and that is where this file is initiating the copy process from the windows side might be an option.

To answer your question in a complete manner, information on current access options is necessary.  You could also use pscp.exe within a batch file on windows to transfer file from a unix/Linux system.
farzanjConnect With a Mentor Commented:
Try this copy command in Unix

cp /unixServer/fileout/myFile.txt  /winServer/filein/

Open in new window

You can put it in a file and that would be your script file.
Lee R Liddick JrReporting AnalystAuthor Commented:
It didn't like the cp command...
If you kindly provide information on what options you have available.

This suggests that samba is not setup such that the unix system can access directly a windows share.
Try from the windows side:
copy \\unixserver\fileout\myfile.txt c:\
Lee R Liddick JrReporting AnalystAuthor Commented:
I found out it was a permissions problem...I'm splitting the points for your time to respond.  Thank you both.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.