Need a persistent "Keep remote directory up to date" setup

Advertisement

kenatsun
Joined:
Posts:
4

Need a persistent "Keep remote directory up to date" setup

WinSCP's "Keep remote directory up to date" feature is just what I need to enable me to edit code on my Windows machine and automatically update changed files to my test environment on a Linux server.

But there are two killer problems when I set up an automatic update using the GUI (see screen shots in attached doc1.doc):

1. The dialog box is modal: Once I set up the automatic sync and hit "Start", the WinSCP GUI is locked up so I can't do anything else in the GUI until I hit "Stop" (which terminates the automatic copying) and then "Close".

2. Worse, when I close the dialog box, then the whole automatic update setup is lost. If I want the same automatic copy to happen again, I have to enter it all over again.

So is there any way to save a "Keep remote directory up to date" setup so it persists and, preferably, automatically restarts whenever I open this particular WinSCP saved session? I'd prefer to do it thru the GUI, so I don't have to learn the WinSCP scripting language, but if scripting is the only way to get this functionality, I'm willing to do it.

~ Thanks!
~ Ken

Reply with quote

Advertisement

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

Re: Need a persistent "Keep remote directory up to date" setup

kenatsun wrote:

2. Worse, when I close the dialog box, then the whole automatic update setup is lost. If I want the same automatic copy to happen again, I have to enter it all over again.
What setup do you mean?
I see you have Use same options next time ticked already.
Do you mean transfer settings? You can make a preset for these.
https://winscp.net/eng/docs/transfer_settings
Startup directoies?
You can make a location profile for it
https://winscp.net/eng/docs/ui_locationprofile

Also what prevents you from running two instances of WinSCP?

So is there any way to save a "Keep remote directory up to date" setup so it persists and, preferably, automatically restarts whenever I open this particular WinSCP saved session? I'd prefer to do it thru the GUI, so I don't have to learn the WinSCP scripting language, but if scripting is the only way to get this functionality, I'm willing to do it.
Depends on what you want to setup.

If just start directories, you can do with just /keepuptodate command line switch:
https://winscp.net/eng/docs/commandline#operations

If you need more, scripting is a way to go
https://winscp.net/eng/docs/scriptcommand_keepuptodate

Reply with quote

ngmunfye
Joined:
Posts:
8

Keepuptodate 2 session 1 screen & Errorlevel option batch on

I currently used WinSCP Version 5.1.2 both GUI/Window Batch Script

I store a session in ini file and used it call from my batch script to do Keepuptodate features.

First Problem: I have configured Option Batch On, so that if error will skip it, my Keepuptodate commands will always monitor and running. But I want to handle If folder exists in Remote directory no need to mkdir. If fail to detect errorlevel if Option Batch are set to On. No matter which method in approaches (such as If errorlevel 1 goto error, If exist folder path do keeuptodate else mkdir only). The result always call mkdir because it cannot detect the errorlevel neither if folder exist in remote path.

Second Problem: I noticed that WinSCP GUI can open multiple sessions at 1 Winscp GUI screen, but if you are doing Keep Remote directory up to date features..It will only work at 1 session at a time. I believe it will be the same if you apply to scripting. Winscp does support up to 9 session transfer at background, is that not support for Keepuptodate features?

Reply with quote

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

Re: Keepuptodate 2 session 1 screen & Errorlevel option batch on

ngmunfye wrote:

First Problem: I have configured Option Batch On, so that if error will skip it, my Keepuptodate commands will always monitor and running. But I want to handle If folder exists in Remote directory no need to mkdir. If fail to detect errorlevel if Option Batch are set to On. No matter which method in approaches (such as If errorlevel 1 goto error, If exist folder path do keeuptodate else mkdir only). The result always call mkdir because it cannot detect the errorlevel neither if folder exist in remote path.
Can you please try again? I'm afraid, I do not understand. Thanks.

Second Problem: I noticed that WinSCP GUI can open multiple sessions at 1 Winscp GUI screen, but if you are doing Keep Remote directory up to date features..It will only work at 1 session at a time. I believe it will be the same if you apply to scripting. Winscp does support up to 9 session transfer at background, is that not support for Keepuptodate features?
The scripting simply does not support concurrent operations.
The support for multiple sessions is useful for interactive use, not that much for batch use.

Reply with quote

ngmunfye
Joined:
Posts:
8

First Problem: I want to know how to check remote folder exist before I issue mkdir command. the scripting are inside winscp, example shown at **. It does not working, mean it always create a folder no matter exist or not.

ECHO option batch on
ECHO option confirm off
ECHO open %session%
ECHO option transfer binary
**IF FOLDER EXIST GOTO MAKE_DIR
ECHO keepuptodate %monitor_path%" -delete -filemask="*.rle,*.res,*.log,*.tar|*.txt"
**MAKE_DIR
**MKDIR %COMPUTERNAME%
ECHO exit

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum