synchronizing script stops work - I was using it for ages

Advertisement

miloskrizan
Donor
Joined:
Posts:
7
Location:
Slovakia

synchronizing script stops work - I was using it for ages

Hello Martin,

I was using this synchronizing script for ages and it worked fine. It should synchronize files, folder, subfolders of local directory to remote(server) with mirror - so copy those existing files that are with newest timestamps AND ALSO copy all files/folders that are not on remote.

option batch off
option confirm off
open sftp://user:pwd@url -rawsettings SendBuf=0 SSHsimple=0 PingType=1 PingIntervalSecs=10 Compression=1 -timeout=10 -hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
option transfer binary
option exclude "[~]*"
synchronize remote -mirror "d:\B I Z N I S\ine" "/cecho/Cloud"
Close

Last days I found out that some of my folders were not synchronized (I am not 100% sure if I ran the remote windows server Update or I updated the Bitvise SSH server - probably yes) But from this moment the synchronizing script mentioned above stops to work. It says: Nothing to synchronize even if there are new folders and files.

I review almost all the forums with synchronizing and I can see that a lot of errors that people made is (from log file) there stayed "ExistingOnly mode" in their log files - that means the script was not correctly coded. But as I said I have never changed my code and it was working. And now I tested it and every time in my log file I can see existing only mode.

Is there any default settings for synchronization? Or what switch exactly I should use to synch also new files/folders?

Thank you

Reply with quote

Advertisement

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

Re: synchronizing script stops work - I was using it for ages

Indeed, the problem is the "existing only" mode.

Your script is not isolated from GUI configuration. It's likely that you have changed your GUI configuration, what broke the script. Try adding /ini=nul switch to WinSCP command-line.
See https://winscp.net/eng/docs/scripting#configuration

with mirror - so copy those existing files that are with newest timestamps AND ALSO copy all files/folders that are not on remote.
This is not what the -mirror mode does. The mirror mode copies all files that have different timestamps. Not only newer, but also older. If you want only newer (and new) files, remove the -mirror switch.

Reply with quote

miloskrizan
Donor
Joined:
Posts:
7
Location:
Slovakia

Re: synchronizing script stops work - I was using it for ages

martin wrote:

Indeed, the problem is the "existing only" mode.

Your script is not isolated from GUI configuration. It's likely that you have changed your GUI configuration, what broke the script. Try adding /ini=nul switch to WinSCP command-line.
See https://winscp.net/eng/docs/scripting#configuration

with mirror - so copy those existing files that are with newest timestamps AND ALSO copy all files/folders that are not on remote.
This is not what the -mirror mode does. The mirror mode copies all files that have different timestamps. Not only newer, but also older. If you want only newer (and new) files, remove the -mirror switch.

Works like a charm! I read the same in the previous posts but I was not sure that this can solve my issue. I tried it earlier but I made some changes on SSH server side, so something was wrong. But anyway I learned that If I do not want to use /ini=nul I can reset the winscp gui into default settings. It is places in Tools/CleanUp https://winscp.net/eng/docs/ui_cleanup
With reseting the settings I did not need to use the meantioned switch.

Thank you Martin. You rock!

Reply with quote

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

Re: synchronizing script stops work - I was using it for ages

miloskrizan wrote:

Works like a charm! I read the same in the previous posts but I was not sure that this can solve my issue. I tried it earlier but I made some changes on SSH server side, so something was wrong. But anyway I learned that If I do not want to use /ini=nul I can reset the winscp gui into default settings. It is places in Tools/CleanUp https://winscp.net/eng/docs/ui_cleanup
With reseting the settings I did not need to use the meantioned switch.
But then you are prone to the same problem sooner or later. The /ini=nul is a better solution.

Reply with quote

Advertisement

You can post new topics in this forum