Synchronize only specific subfolder local-remote

Advertisement

filiq_
Joined:
Posts:
1
Location:
Netherlands

Synchronize only specific subfolder local-remote

Hello I'm tryin' to sync my local files to my server, I got this script from internet.

@echo off
setlocal
 
REM Set your local and remote directories
set LOCAL_DIR=G:\SteamLibrary\steamapps\common\Half-Life\cstrike\addons\amxmodx
set REMOTE_DIR=/cstrike/addons/amxmodx
 
REM Run WinSCP script
"C:\Program Files (x86)\WinSCP\WinSCP.com" /command ^
    "open sftp:/edited/" ^
    "synchronize remote %LOCAL_DIR% %REMOTE_DIR% -filemask=""|*;configs/*;plugins/*;data/lang/*;""" ^
    "exit"
 
endlocal
I want only the folders configs/*;plugins/*;data/lang/* and all the files inside I want to be moved from my computer to server. But it gets everything and the inside files no.

Reply with quote

Advertisement

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

Re: Synchronize only specific subfolder local-remote

I agree that one synchronize command for each of the subfolders might be the cleanest way to go. Using the filemask is not easy, when need to select a subfolder of a subfolder (the data/lang). Were it about direct subfolders only (like the configs and plugins), the way to go would be:
./configs/;./plugins/

Reply with quote

smythwx
Joined:
Posts:
3
Location:
Virginia

Automatic sync of folder to server

Hello,
New to this program but so far it seems to have a lot of power. My need is to automatically check a folder for a modified radar image and then log on to my web server and FTP that image to the directory on the folder. Can this be done with this program?
ALL help appreciated as I'm not the sharpest knife in the drawer on developing scripts.

Thanks in advance!

Wayne
https://www.smythweather.net

Reply with quote E-mail

Guest

@smythwx: I wanted to do something to help you, so there is this way as one example:
https://winscp.net/eng/docs/guide_automation
https://winscp.net/eng/docs/guide_schedule

It can be quite complex. Synchronize can be used to make it more simple, but it does sacrifice speed. This is the part where I wish to not get into anything further.

It would be a really cool feature though to be able to automatic directly in the WinSCP UI like WYSIWYG style. Like click on a folder and select it for automatic backups and it does the rest including setting up the automatic part. But, that doesn't exist. It could but doesn't. Would be a fantastic selling point though.

Reply with quote

Advertisement

smythwx
Joined:
Posts:
3
Location:
Virginia

automatic sync of folder to server

Thank you so much for the reply ! I definitely need help on this LOL
I will read these posts you replied and hopefully learn something :)

Much appreciate the help
Wt

Reply with quote E-mail

smythwx
Joined:
Posts:
3
Location:
Virginia

automatic sync of folder to server

@Guest: I have been knew the exact command line for keeping a servers folder updated. This all has come about due one of my software's inability to upload SFTP and that became a problem when for some reason I can no longer upload on port 21 from home. I think my ISP has been screwing around where they shouldn't have and possibly blocked port 21. Although secure uploads would be better in a world where plain insecure FTP is definitely outdated

Wayne

Reply with quote E-mail

Advertisement

You can post new topics in this forum