how to move files from a windows machine to unix machine using scp

Swaminathan_K
Swaminathan_K used Ask the Experts™
on
Hi,

I have to write a unix script to move a file in Windows to Unix machine for deplyment purpose  I have decided to use scp , can any one guide me on how use this to tool using  a unix script to move files.

thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2010
Commented:
: steps to copy file from windows to Unix machine
Download PSCP.exe
Place the PSCP.exe in same folder as ur text file to be moved
From the command prompt , traverse to the folder conataining PSCP.exe
 Execute the following command
PSCP.exe <fileName to be moved> <loginName of Unix>@<Ip address of Unix Box>: /home/urname/Desktop
files will be copied in  /home/urname/Desktop


Please check this link for example
http://e-articles.info/e/a/title/Transfer-files-from-the-command-line-with-PSCP/

Hope this helps
I believe since you're wanting to use the Unix machine, you're going to need an SCP daemon or service running on the Windows machine.  You can google around for the best program to meet your needs.  Try keywords like 'scp windows service' or 'scp windows server' or 'scp windows daemon'.

Once you have that running, your script will need to be something have something like:
scp -rp @:/ ///

where -r will recursively copy the files and -p will try to preserve permissions and file dates.

How will your deployment script know to run?  Will it be manually requested or run on a timer?  if you're trying to use a schedule to copy the files, you can use a unix utility called cron to pull files on a regular schedule.
Top Expert 2007

Commented:
If you are happy to do this manually, then just use winscp.

http://winscp.com
If you're looking for a GUI tool for the transfer and want something free, you could try Tunneler
http://www.bitvise.com/tunnelier

I still prefer WinSCP, but it's pretty good.
Oops, I was thinking of something else... WinSCP is free too :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial