Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

WinSCP has a great feature that only copies newer versions of files when you transfer between hosts. For whatever reason, I'm not able to connect to my remote host via WinSCP so I must use SSH. I don't want to overwrite ever file in the target folder, only the new ones. Does this happen automatically?

Additionally, for the protocol: scp -r [/path/filename][login@ipaddress]:. what is the home directory of the filename path? Is it simply C drive? I know I can write the full path but I'm just curious.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I think you have a lot of misguided thoughts here.

First... Winscp uses native ssh to copy files. It does nothing different than the linux command scp. There is no way scp will work... when winscp does not. winscp is a windows interface that uses a basic scp client to connect to a ssh server to copy files.

Second... In Linux-based OSes, there is no concept of a "C drive". You have the root (/) and directories under root. A block device is mounted to root, and various other block devices can be mounted to directories that fall under root.

The syntax for "scp" is as follows:

scp from_where to_where

Both the from and to can be local directories like /some/local/directory or a remote directory like user@some.server:/some/remote/directory

the -r just means to "recurse" directories. (copy everything from that directory and everything beneath it.)

in a windows environment with a "C drive" typically you'd use putty's pscp command and do something like this:

pscp -r c:\some\directory username@some.server:/some/path/to/where/you/want/it
share|improve this answer
    
This is all great but in answering the original question: Is overwrite if new a default for scp? –  AlxVallejo May 9 '12 at 15:00
    
Since scp is rather simple... (doesn't do much beyond copying) It doesn't have any way to determine if there are newer files on the remote side. Your best bet is to look at rsync or unison over ssh or use some enhanced scp/sftp client like winscp. –  TheCompWiz May 9 '12 at 15:52
    
I prefer scp FromHere ToThere –  Amit Naidu Sep 11 '13 at 18:09
    
@AmitNaidu alas... Windows does not have a native scp client. You can use putty's pscp... or cygwin's scp... or some other 3rd party scp client... but I find putty is crazy-small and extremely powerful/efficient. –  TheCompWiz Sep 12 '13 at 23:38
    
Oh I know! That was just a little joke about your syntax example. Underscores trip me up with readability especially when mixed with spaces. Whereas camelCase helps a lot. Plus the where-to-where vs here-to-there thing...oh well, so my PJ got boo'd. –  Amit Naidu Sep 13 '13 at 20:04

If your priority is to overwrite with newer copies, I recommend rsync.

cwRsync is a version you can use with Windows: http://www.rsync.net/resources/howto/windows_rsync.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.