how to always replace the remote file if the source file size is different (larger OR smaller)

Advertisement

cuxcrider
Joined:
Posts:
3

how to always replace the remote file if the source file size is different (larger OR smaller)

I would like to replace remote files with the source files when the file size is different. The file size can be larger or smaller, it does not matter. I also do not care about the time stamps being older or newer.

My source files are on a windows machine, the remote system is a Ubuntu server. The files are binary files.

There are no errors, the files are simply not recognized.

I have tried the following scripts with the following results:
synchronize remote -mirror
(this will not replace a remote file that has a larger file size than the source file)

synchronize remote -mirror -criteria=size
(same result as above)

synchronize remote -criteria=size
(same result as above)

Hopefully I am just missing something simple. Thanks!

Reply with quote

Advertisement

cuxcrider
Joined:
Posts:
3

ok, maybe I was wrong.
using the criteria flag worked for me just now to replace a remote file that was larger than the source file.

Should I need this criteria flag however with 'mirror'?

My exact script:
synchronize remote -mirror -criteria=size

Reply with quote

cuxcrider
Joined:
Posts:
3

sorry for another message, but now I just confirmed the exact opposite behavior on a separate system. This has been my confusion. I am testing this on multiple machines, all uploading microsoft access files, and I seem to get different behavior on different machines, and possibly on different days of the same machine as I try to debug the problem.

Now when I do NOT include -criteria=size all the files are updated, but when I include the flag they are ignored.

Any thoughts on the proper method? Does the order of the flags matter?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
33,516
Location:
Prague, Czechia

Re: how to always replace the remote file if the source file size is different (larger OR smaller)

Please attach a full session log file showing the problem (using the latest version of WinSCP). Give us a name of a file that is handled incorrectly.

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Advertisement

You can post new topics in this forum