0

I use Windows 7 machine and Putty to connect to UNIX servers. I am required to FTP certain files from those server to my local windows machine. For this purpose I use a FTP client like FileZilla or WinSCP.

However, I want to create a script , that would:

  1. Connect to unix server from my windows machine.
  2. FTP file from certain directories to windows machine.
  3. Terminate the connection after the FTP download is complete.
  4. This should occur periodically.

I have installed rsync 3.0 and cygwin. When I enter the following command:

rsync -e ssh user@host:/remote_directory .

It asks me: Enter Securid PASSCODE:. and I enter the password for the same, but I get the error:

sh: rsync:  not found.
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: remote command not found (code 127)
   at /home/lapo/package/rsync-3.0.9-1/src/rsync-3.0.9/io.c(605) [Receiver=3.0.9]

Please help me in understanding why I face this problem.

2
  • Is rsync installed on the linux server?
    – 3molo
    May 14, 2012 at 5:36
  • 1
    By "FTP", do you mean FTP or SFTP?
    – mgorven
    May 14, 2012 at 6:12

3 Answers 3

1

Use cURL instead. rsync won't do what you require.

0

I think you are getting this error because rsync path cannot be found try with the full path.

You can do that with curl too but I understand can be done with rsync or you could try scp. I don' understand if you have the FTP server installed or you are just using SFTP thru the SSH...

0

FTP is one protocol/command suite (legacy, one of the original Internet protocols with TELNET), SCP is another one (uses SSH, a encrypted connection for running commands remotely, also used to copy files to and fro). RSYNC is a program/protocol to remotely synchronize files (over slow network connections), again separate from the above. Today most file shipping is done over HTTP, as it became to be synonymous with Internet for the unwashed masses in the 2000s (and thus all infrastructure has been carefully optimized for it).

Each alternative (there certainly are others...) requires it's own server and client setup. There are some multilingual programs around, e.g. wget and curl, that speak HTTP and FTP, and perhaps other protocols too (cURL is for "see URL", it is meant to handle all sorts of URLs). Availability may vary among operating systems. Also consider that fascist firewall setups may forbid the use of some protocols.

Which alternative to use is mostly a matter of taste. The advantage of rsync is that it tries hard to minimize network traffic, just transferring changes. Others copy everything over. The SSH suite is flexible and handles user authentication uniformly, for remote commands and copying files to and fro, and adds strong cryptography. FTP and HTTP based tools (FTP clients, wget, curl) allow you to fetch stuff from publicly available sources (i.e., get a lot of source code packages, grab all PDF files making up a book published online), no need to have special access to the source system.

You must log in to answer this question.

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