How to synchronize remote one single file, please help me.

Advertisement

LeWeir
Guest

How to synchronize remote one single file, please help me.

How to synchronize remote one single file from local directory C:\ to remote directory /, please help me.

I trial and error hours and still cant make it work, I've tried
option include test.txt
synchronize remote -preview "C:\" "/"
synchronize remote -filemask=_qw.txt -preview "C:\" "/"
but the WinSCP STILL compare all the folders and files in C:\, why...?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,984
Location:
Prague, Czechia

Re: How to synchronize remote one single file, please help me.

Your scripts synchronize all files with given names, anywhere on the C:\ drive.
If you do not want to synchronize subfolders, see:
How do I transfer (or synchronize) directory non-recursively?
The the final script will be like:
synchronize remote -filemask=_qw.txt|*/ -preview "C:\" "/"
The same can also be achieved with put -neweronly:
put -neweronly C:\_qw.txt /

Reply with quote

LeWeir
Guest

Re: How to synchronize remote one single file, please help me.

Thank you so much sir. You're a lifesaver, but I have one more question, I know I can use
synchronize remote -filemask=A.txt;B.txt|*/ "C:\" "/"
to sync A.txt and B.txt files. But how about a file A.txt with a directory called my_folder?

I tried
synchronize remote -filemask=A.txt;my_folder/|*/ "C:\" "/"
and
synchronize remote -filemask=A.txt;my_folder\|*/ "C:\" "/"
but it didn't work. :(

Reply with quote

LeWeir
Guest

Re: How to synchronize remote one single file, please help me.

But if the feature is not supported then I will just use put with -neweronly argument as your suggestion, but the stdout still output even WinSCP didnt sync anything is kind of weird :|
Anyway. I love WinSCP already, it's super useful for me rn. :) Starred WinSCP!

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,984
Location:
Prague, Czechia

Re: How to synchronize remote one single file, please help me.

What do you mean by "with a directory"? Do you mean "in a directory"?
This should do (i.e., drop the |*/):
synchronize remote -filemask=A.txt;my_folder/ "C:\" "/"
Or simply:
synchronize remote -filemask=A.txt|*/ "C:\my_folder" "/my_folder"

Reply with quote

Advertisement

You can post new topics in this forum