"Keep remote directory up to date" does not sync files with different file size

Advertisement

passuff
Joined:
Posts:
15

"Keep remote directory up to date" does not sync files with different file size

I'm syncing some folders with mentioned method but I don't get it to sync files with different file size. I can see the comparison in the log (xyz is modified comparing to remote file abc) but the file is not transferred.
I did not find any setting which activates the transfer based on different file size.
Anybody can support?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,469
Location:
Prague, Czechia

Re: "Keep remote directory up to date" does not sync files with different file size

The "Keep remote directory up to date" function uploads only newer files. It does not consider the sizes, nor does it upload files that are older than the remote ones.

Reply with quote

passuff
Joined:
Posts:
15

Let me rephrase my issue...
When "Keep remote directory up to date" is started, it will do a synchronization run first:



Unfortunately this sync run does not take the global sync settings, where I configured file size:


How can I adjust the sync settings inside "Keep remote directory up to date" for file size?

Reply with quote

martin
Site Admin
martin avatar

The point of the "Synchronize on start" is to bring the folders to a state that the "Keep remote directory up to date" considers synchronized. It won't be, had the "Synchronize" used different criteria than the "Keep up to date".

Reply with quote

Advertisement

passuff
Joined:
Posts:
15

But then I don't get why I can't edit the settings to compare by size for all. My scenario:

In my system AppXY produces corrupted files sometimes (locally) that are synced to a remote directory by "keep remote directory up to date". The local Appxy recognizes the corrupted file after a short time and repaires it. The only thing that changes is the file size. Unfortunately "keep remote directory up to date" does not recognize it.

Maybe I can do a Sync after 15min of "keep remote directory up to date". But Then I do need to use batch/scripts...
Any idea what I can do??

Reply with quote

passuff

But I have "keep remote directory up to date" running in the same folders 24/7. Can I still run the sync job in parallel? I would think this leads to conflicts on folder/file access or something like that and I need to end "keep remote directory up to date" before starting the sync job. But terminating "keep remote directory up to date" by schedule is not possible AFAIK.

Reply with quote

martin
Site Admin
martin avatar

No, you should not run them in parallel. I've though you want to replace the "keep up to date" with the scheduled task.

Reply with quote

Advertisement

passuff

OK then. Lets assume I just want to use synchronize job 24/7. Let me say it sometimes could take 3h to finish a sync job and sometimes 5s. So a syncing on a fixed schedule won't work. Is there a way to begin a new job as soon as the old one has finished? I tried it with Windows scheduler but it actually ignores running sync jobs, starts a new session and then everything crashes because of access violation...

Reply with quote

passuff
Joined:
Posts:
15

I found a way to script it by batch - unfortunately the sync session does not automatically close after finishing the job. I get the message "No differences found" if there are no differences which needs to be confirmed before the app terminates. This is really bad if you want to automate things. Is there a way to use sync jobs without prompting anything?

EDIT:
Additionally I get the following message from time to time and is not able to reconnect automatically... Seems /synchronize is not really good for automation...

2021-06-18 14_24_20-int02236 - Remotedesktopverbindung.png

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,469
Location:
Prague, Czechia

Indeed, /synchronize is not for automation. For automation, use scripting and its synchronize command:
https://winscp.net/eng/docs/guide_automation
https://winscp.net/eng/docs/scriptcommand_synchronize

If you want to keep running the synchronization forever, just loop the WinSCP script. For example the following trivial Windows batch file will do:
:LOOP
winscp.com /ini=nul /script=sync.txt /log=sync.log
goto LOOP

Reply with quote

passuff
Joined:
Posts:
15

That's exactly what I did- at least I think so:
SET "log=WinSCP_Loop.log"
echo %date%-%time% starting WinSCP_upload > "%log%" 
:loop
start /wait C:\WinSCP\WinSCP.exe "Session"  /defaults /synchronize
echo %date%-%time% restarting WinSCP >> ""%log%" " 
goto loop
Unfortunately, I get those two messages I mentioned above...

BR

Reply with quote

Advertisement

passuff

I recognized that but I did not expect any difference between putting /synchronize and /script=sync.txt containing synchronize job.

I will try. Thx for your patience with me ;)

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum