0

how i can write bash file to copy files from unix box to windows "remotly" box by sftp command ???

2 Answers 2

2

For automated scripts, try scp or rsync.

from "man sftp":

-b batchfile Batch mode reads a series of commands from an input batchfile instead of stdin. Since it lacks user interaction it should be used in conjunction with non-interactive authentication. A batchfile of â-â may be used to indicate standard input. sftp will abort if any of the following commands fail: get, put, rename, ln, rm, mkdir, chdir, ls, lchdir, chmod, chown, chgrp, lpwd, df, and lmkdir. Termination on error can be suppressed on a command by command basis by prefixing the command with a â-â character (for example, -rm /tmp/blah*).

also look at http://www.computing.net/answers/unix/automated-sftp-script/7006.html

1
  • ok i know but the other side "windows" put condition "use sftp" maybe it is don't support scp Nov 29, 2010 at 8:11
0

The cURL php extension for windows supports sftp. You should try to find a php script that you can place on the windows server and add to scheduled jobs. Wouldn't be too hard to create your own either. I'm sure python and .net have support for sftp as well.

Or, you could install cyqwin (nasty hack) on windows and write a bash script.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .