Script for FTP/SSH with winscp

I am looking to monitor an FTP site for files and automatically transfer them when files appear.  I use winscp as the client, and really if I can create a script of some sort that just runs at a certain time/times that would also work.  So at 5AM login to a site using winscp, copy all files from that site and then move them to a mapped drive, removing the files off of the winscp site.
LVL 1
rhwimmersAsked:
Who is Participating?
 
Mark BullockQA Engineer IIICommented:
If your problem is simple you can do it with a single winscp command and then a delete command if the winscp command succeeds. Here's an example of a winscp command to copy a file.
http://winscp.net/forum/viewtopic.php?t=10032

If it's more complicated, here's some information about the exact same problem you want to solve. They suggest .NET. I think you could also write a powershell and probably even a .bat script.
http://winscp.net/eng/docs/faq_delete_synchronized_files

Another option is to use cygwin (bash shell which runs on Windows) with its openssh package to get the scp command. Then you can write a simple bash shell script to copy the files. You can schedule a cygwin command in the Windows task scheduler.
0
 
Mark BullockQA Engineer IIICommented:
You can write scripts using winscp.com.  You can schedule a task in Windows to run every morning.

Scripting details are here. There's an example at the bottom of the page.
http://winscp.net/eng/docs/scripting
0
 
rhwimmersAuthor Commented:
Thanks.  After review I was given the wrong information.  A file will appear on a windows network (mapped drive or unc path) sometime in the middle of the night.  I just need to open up a connection and move (not copy) *.* from the mapped drive and put on the ssh server.  Is this still something I could use winscp for or is there a better way that you can think of?
0
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.