Topic "Synchronizing based on a partial filename"

Author Message
AlphaUno
[View user's profile]

Joined: 2012-08-13
Posts: 5
Location: Nashville, TN
Hi I am wanting to create some script that will move all the files from an one of my servers to another. This is going to be used for backup purposes and run often.

I see the synchronization is the way to go and I have easily created some batch files that will do this with winscp. Very Happy

However my problem lies in that I don't want all files from that folder moved only ones with the a file name that begins with "cl" but the rest of the file name is different and may have a completely different file extension.


Here is my code as I think it should work Exclamation...taking off the filemask and it works great moving over all of my files but that's only half of my objective as I only want the ones with cl.
Code:

open asp1_checks

pause


synchronize -filemask="cl.*" local "Y:\checks\" "/asp1/luminx/naa/live/jacob/checks/"

exit
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
1) There's no pause command in WinSCP
2) More appropriate mask may be "cl*".
_________________
Martin Prikryl
AlphaUno
[View user's profile]

Joined: 2012-08-13
Posts: 5
Location: Nashville, TN
Thanks prikryl for the response!

I have tried that and to be safe just tried it again. I also want to point out that If I run this with winscp synchronization (not via scripting) and I set a file mask it does work correctly. Wish there was a way to convert a successfully operation to script Confused

As you may have guessed most of the directories are virtualized and because of this some of the software tends to get out of date. I did notice the current version I have is 4.3.7 Build 1679. I'm wondering if there was a problem to the file masking ability that has been corrected since this version?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
There's no -filemask switch in 4.3.7.
You get "Unknown switch 'filemask'." error.
You should see that in the console or log.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License