Topic "Exclude certain file on Synchronize"

Author Message
joeahn

Guest


Hi,

Is there a way to exclude certain file when using Synchronize. If yes, could you give me a simple example code.

Thanks
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
Code:
option exclude <yourfilename>
synchronize ...

_________________
Martin Prikryl
3K
[View user's profile]
Donor
Joined: 2012-01-20
Posts: 34
Location: Geneva
Hi,

Is there a command to synchronize files starting from a specified date stamp? I would like to exclude files if their file's modified dates is before 1 Jan 2012.

Thanks.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
Thanks for your post.

This request is being tracked already:
http://winscp.net/tracker/show_bug.cgi?id=672
_________________
Martin Prikryl
3K
[View user's profile]
Donor
Joined: 2012-01-20
Posts: 34
Location: Geneva
In Tracker Bug 672, the status is Fixed in: 5.0.6. Does it mean version 5.0.6? Is it possible to download this version and know the command to exclude by time stamp? Currently, in the download page, we can see 5.0.5 but not 5.0.6.

Thanks.
3K
[View user's profile]
Donor
Joined: 2012-01-20
Posts: 34
Location: Geneva
In Tracker Bug 672, the status is Fixed in: 5.0.6. Does it mean version 5.0.6? Is it possible to download this version and know the command to exclude by date stamp (not time stamp as written in my previous post)? Currently, in the download page, we can see 5.0.5 but not 5.0.6.

Thanks.
3K
[View user's profile]
Donor
Joined: 2012-01-20
Posts: 34
Location: Geneva
Is it possible to request pre-release version (5.0.6) of WinSCP? I recently donated a small amount. Thanks. Smile
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
I have emailed you a link to development version of WinSCP.

Syntax file mask with timestamp is:
<2012-02-01 00:00:00
_________________
Martin Prikryl
3K
[View user's profile]
Donor
Joined: 2012-01-20
Posts: 34
Location: Geneva
prikryl wrote:
I have emailed you a link to development version of WinSCP.

Syntax file mask with timestamp is:
<2012-02-01 00:00:00


Thanks a lot Martin, got the development version. In my script below, if I wanted to synchronize documents posted >= 2012-01-01 00:00:00, where will I insert the command:

Code:
open ftp://username:password@ftpserver.itu.int
synchronize local C:\TEST\docs /docs
close


Thanks again.

Regards
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
Code:
synchronize -filemask="<2012-02-01 00:00:00" local C:\TEST\docs /docs

_________________
Martin Prikryl
3K
[View user's profile]
Donor
Joined: 2012-01-20
Posts: 34
Location: Geneva
prikryl wrote:
Code:
synchronize -filemask="<2012-02-01 00:00:00" local C:\TEST\docs /docs


Thanks Martin, that command works well, Very Happy excellent.
3K
[View user's profile]
Donor
Joined: 2012-01-20
Posts: 34
Location: Geneva
Hi Martin,

I was trying to synchronize with filemask and include Word documents (*.doc*) only using the commands below, but it seems, it doesn't work:

Code:
option include=*.doc*
synchronize -filemask="<2012-02-01 00:00:00" local C:\TEST\docs /docs


Code:
synchronize -filemask="<2012-02-01 00:00:00" local C:\TEST\docs /docs -include="*.doc*"


Could you kindly help me.
Thank you.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
The -filemask swich overrides include option (which is obsolete anyway with 5.0.6).
Also there's no -include switch.

Correct syntax is:
Code:
synchronize -filemask="*.doc*<2012-02-01 00:00:00" local C:\TEST\docs /docs

_________________
Martin Prikryl
3K
[View user's profile]
Donor
Joined: 2012-01-20
Posts: 34
Location: Geneva
Thanks again, it works. That command filters Word doc with timestamp.

Another question, if I would like to include multiple filters, for example, Word (*.doc*) and Powerpoint (*.ppt*) files, what will be the command. I tried the command below, but it doesn't work.

Code:

synchronize -filemask="*.doc* *.ppt* <2012-02-01 00:00:00" local C:\TEST\docs /docs


Also, is it possible to have the new switch commands available for synchronize?

Many thanks for your excellent support.

Regards.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
Code:
synchronize -filemask="*.doc*<2012-02-01; *.ppt*<2012-02-01" local C:\TEST\docs /docs


Quote:
Also, is it possible to have the new switch commands available for synchronize?

Do not understand.
_________________
Martin Prikryl
3K
[View user's profile]
Donor
Joined: 2012-01-20
Posts: 34
Location: Geneva
Thank again Very Happy , that command worked perfectly.

For my other question, is there a web page describing the new Synchronize command, with examples? If there is none yet, it's ok.

Regards.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
3K wrote:
For my other question, is there a web page describing the new Synchronize command, with examples? If there is none yet, it's ok.

The up-to-date documentation is on the same page all the time:
http://winscp.net/eng/docs/scriptcommand_synchronize
_________________
Martin Prikryl
3K
[View user's profile]
Donor
Joined: 2012-01-20
Posts: 34
Location: Geneva
What will be the equivalent command of filemask in .NET Assembly as shown below?

synchronize -filemask="*.doc*<2012-02-01; *.ppt*<2012-02-01" local C:\TEST\docs /docs

.NET example:
synchronizationResult =
session.SynchronizeDirectories(
SynchronizationMode.Local, @"C:\TEST\docs", "/docs", false);


Thank you.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
3K wrote:
What will be the equivalent command of filemask in .NET Assembly as shown below?
...

Please use .NET assembly / COM library forum.
_________________
Martin Prikryl
GerMurphy

Guest


I was wondering how to sync all folders on my desktop computer with those hosted on a remote server.
I have established connection with the server and been able to synchronize with it but there are folders to which I do not have the required permissions and I wish to exclude them from the sync.

This is not a problem if doing it manually but I wish to automate the process.
Shikhil

Guest


Dear Team, need to know how to script winscp to rename the newly copied file to the destination, if it already exists there. Kind of file versioning.
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