ftp - File/Folder sync using PuTTY

07
2013-09
  • mswanberg

    I looked around and couldn't find anything for this.

    There are many programs that allow syncing over FTP or SFTP. But here's the rub. I am behind a proxy which causes 2 main issues. First, the proxy prevents normal SSH connections; but I have been able to get a PuTTY connection established with no problem. Second, the FTP proxy server does not handle "standard" FTP commands to change remote file timestamps (such as MDTM). So this causes syncs to not work because every time a file is uploaded, it gets a new time, which then makes it not match the file again, and so on. I'm trying to sync/backup files that have changed only when they change.

    My needs are several:

    1. It would be nice to use established software... SyncBackSE, GoodSync (which supposedly uses PuTTY but I can't get it to work), rsync, etc. In short, I don't want to write my own code, if I can avoid it. Many canned programs are flat-out blocked by the proxy (DropBox, for instance).

    2. I'd like not to have to get too deep into this... editing .conf files, running daemons, etc. is beyond what I would prefer.

    3. 2-way sync is preferred, including folders, deletions, etc.

    What I've looked at:

    • Endless searches on SFTP, ssh through a proxy server, rsync through PuTTY, port forwarding for FTP (passive mode kills me every time on this), and dozens of others.

    • GoodSync. Supposedly lets me use PuTTY creds, but I can't figure out how.

    • Writing my own software to do this. Usually ends up having issues with opening new connections for each file transfer (slow), or issues in figuring out what files are new, deleted, etc., time (I don't have that much time to devote to this).

    Has anyone tried this and succeeded? If so, how?

    Thanks in advance for any assistance.

  • Answers
  • ccpizza

    Since you can connect through Putty using the proxy then probably the easiest would be to add a socks proxy in Putty, i.e. a dynamic port forward, and then out of all of the backup tools you tried pick one which can work through socks proxy, i.e. WinSCP.


  • Related Question

    unix - From within telnet (putty), can I download a file to my computer?
  • user3183

    I generated a key for use with SSH (Subversion) on my Unix server, and I need to download the key.

    I tried to use an FTP program but the folders are hidden i.e. /.ssh/

    Can someone download them while in my putty/telnet session?


  • Related Answers
  • Mark

    You can use SCP or SFTP for transferring files over SSH.

    But you should be able to do what you need in your ftp client. Look in the client's settings for where you can set the list command, and append "-ah" to the end of it. Your ftp client might even have a setting to display hidden files

  • dlux

    You could try using Le Putty and do a ZMODEM transfer using sz.

  • jottos

    I had similar problem, I used the copy feature in putty - just select (hilites text) in putty window and you can paste directly into Windows app. This is ok for key files since they will fit in one screen.

    If you have a larger amount of text I've resorted to just mailing the file I need to myself

  • Duck

    Is there something preventing you from copying them to a location from which you can FTP them?

  • dmckee

    Best to use sftp or an ftp client that will allow you to display and get hidden files.

    But the answer to the question as written is: in the bad-old-days, we used [xyz]modem to do this. Putty may even have this technology built in, but you'll need the send client (called sz on unix machines) at the far end for this to work.

  • mwalling

    I'm assuming since you're using PuTTY, that you're probably running from Windows, and you're connecting over SSH, not Telnet (since you talked about generating an SSH key for SVN). If so, you might want to look into WinSCP, instead of using FTP to access your data on the remote system. (SCP/SFTP adds in the inherent security of SSH, whereas FTP passes your username and password "in the clear" to the remote system). It's a graphical client that is built on top of the PuTTY source.

  • Chris W. Rea

    I like the ZModem suggestion, but I'm surprised nobody has suggested uuencode yet, which shouldn't require a different SSH client -- assuming most terminal packages can simply log the terminal output to a file. Even if it can't, short enough files fit on screen and can be copy/pasted to a Notepad window.

    So, on the UNIX side, uuencode the binary file you want to send, capture the terminal's text output of that uuencoding to a text file in Windows, and then uudecode that text file on the Windows side to reconstitute the original binary file. Very primitive, but it works like a charm.

    See this Wikipedia article on Uuencoding. I trust you can find uuencode/uudecode utilities as part of the excellent Cygwin project.

  • dbr

    For a SSH key specifically, you can probably just make the terminal window larger, cat ~/.ssh/id_rsa.pub and copy the key (by selecting the text) and pasting locally.

    For larger, or binary files, look into SCP (or SFTP)

  • contact us

    You're using Putty, which is basically 30 year old technology. Back in those days it was too difficult to add multitasking to user level software, so the answer is "no".

    You'll need to start another program, scp, etc. and use it to transfer the files. If both sides, client and remote system, are unix, you can use ~ followed by ctl-Z (no space or return after the tilde) and that will suspend your putty session and then you can start using scp, or whatever, to transfer the file. After that's done then use the unix fg command to reconnect to your suspended, background putty.