« Previous Next »

Thread: synchronize files with certain extension only

Last post 07-21-2009 10:18 AM by SuperTramp. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 07-21-2009, 6:03 AM

    • raskado
    • Not Ranked
    • Joined on 07-14-2009, 2:08 AM
    • Posts 13

    synchronize files with certain extension only

    Hi

    I have a folder named MySite, containing number of folders and  larg number of .htm and .asp files, and same folder in remore server, I want to synchrize only .asp files with correspondent files on remote server, How can it be done? in short, is it possible to exclude folders or certain extensions from synchronization?

    Thanks

    kiarash

  • 07-21-2009, 10:18 AM In reply to

    Re: synchronize files with certain extension only

    Yes.  MSDeploy supports a skip directive that lets you skip parts of the sync.  The directive is kind of f***ing complcated, but it will get the job done.  In your case, you want to skip all files that "Don't look like *.asp".  This is complicated since you want to skip a negative condition. 

    Add this parameter to your command line:

    -skip:objectName=filePath,absolutePath=\.(?!asp)

    Now your sync will only sync ASP files. 

    If you wanted to skip just a given folder called "foobar", its a little easier

    -skip:objectName=dirPath,absolutePath=\\foobar

    What follows the absolutePath in both cases is a regular expression to match against.  In the first example, that regular expression is a negation which will match all files that don't look like *.ASP.

    Hope that helps

Page 1 of 1 (2 items)
Microsoft Communities