CRS: Use of Project Filters at the Command Line (265260)



The information in this article applies to:

  • Microsoft Site Server 3.0
  • Microsoft Site Server 3.0 Commerce Edition

This article was previously published under Q265260

SUMMARY

You can use command line options for Microsoft Content Replication System (CRS) to automate the content replication process.

Note, that you must be careful when you use filters with the project.

This article covers the following topics regarding the use of project filters at the command line:

  • How to include filters when you add a CRS project by using "crs addproj" or "sscd addproj".
  • Syntax for including filters for more than one directory.
  • Syntax for dealing with filename, and directory names that have space characters.

MORE INFORMATION

How to Include Filters

To add a project from a command line with filters, use code similar to the following:
CRS AddProj <ProjectName> <SourceDirectory> [Dest1 | Route1] [...] [/Filter <filters>] [GlobalFlags]

The [Global Flags] includes:
  /Server <ServerName>
  /User <user> [pass | *]<BR/>
				
For Filters:

 +<filter> Includes the file or directory filter.
 -<filter> Excludes the file or directory filter.
 \         Applies the filter to directories.
 ...\      Applies the filter to all sub directories.
 <filter>  A file or directory filter that can use wildcard characters.

 Example:
 /Filter "+text1.txt -*.exe -dir1\ +...\*.jpg"
 This filter would include text1.txt, exclude all files ending
 in .exe that exist in the project root directory, exclude the
 directory dir1, and include all *.jpg files in the entire
 directory tree.
				

How to Include Filters for More Than One Directory

To include more than one directory in the filter, use code similiar to the following:
CRS Addproj MyProj_1 c:\sourceDir c:\destDir /Filter "-dir1\ +dir2\ "
				
NOTE: Make sure that there is a space after the last backslash ("\") and before the closing quotation mark.

You can also use wildcard for directories. For example, to exclude the _vti_* directories that are installed with Microsoft FrontPage Server Extension (FPSE) and to include directories named myWeb## use the following:
CRS Addproj MyProj_1 c:\sourceDir c:\destDir /Filter "-_Vti*\ +myWeb*\ " 
				

How to Deal with Filnames and Directory Names with Space Characters

Space characters inside the filename or directory name may cause problems in the command line syntax for CRS project filters.

There are several ways to work around this depending on the filtering needs. For example, you may consider the use of wildcards to bypass the space in a name. For example, to exclude a subdirectory under the replication root named "My Folder", use the following:
CRS Addproj MyProj_2 c:\sourceDir c:\destDir /Filter "-My*\ " 
				

Modification Type:MajorLast Reviewed:6/28/2004
Keywords:kbbug kbfix KB265260