Skip to main content
1-Visitor
April 25, 2016
Solved

How to use resync command to get a version of all files with a specific extension?

  • April 25, 2016
  • 1 reply
  • 6673 views

In the process of creating a Sandbox with several levels of directories and with many files, sometimes I'll need to update all files in it with a .docx extension or .csv extensions to a specific version or latest checked in. I've had no luck so far, as the resync for some reason is not recursing down directory levels. I've tried stuff like this:

si resync --revision=:head --recurse --sandbox="/home/ls897/perl/head_foot/sbx/design/code/project.pj" "/home/ls897/perl/head_foot/sbx/design/code/*.doc"

With this response: The file *.doc is not a current or destined or former or pending member or a subsandbox.

si resync --revision=:head --recurse --sandbox="/home/ls897/perl/head_foot/sbx/design/code/project.pj" "*.doc"

With this response: *** MKS125335: Out of tree members and subprojects (not located in the project directory or a subdirectory of the project directory) are not supported.

Best answer by jerazo

Ok, I figured out how to make it do what I wanted it to do. Your replies helped! Thanks.

Here's how the command worked for me:

si resync --revision=:head --recurse --overwriteUnchanged --filter=file:"*.c" --sandbox="/home/perl/build_scripts/sbx/project.pj"

This downloaded and/or overwrote the file with head revision for ".c" files only into the local directory.

1 reply

16-Pearl
April 26, 2016

Hi Juan,

on the GUI you can choose F11 (select member) in your Sandbox. The upcomming dialog offers you the chance to enter a name filter like *.docx

alternatively  the CLI offers a --filter option for the resync command.

Please see the manual for details

        --filter=attribute:name=*.docx

jerazo1-VisitorAuthor
1-Visitor
April 26, 2016

Matthias,

I'm in need of scripting this with CLI. The filter doesn't seem to help me, since I don't want to remove the files, but instead I want to request a specific version of all .doc files. If you see in the commands I've provided, there I'm requesting the head revision. Unfortunately that command is not working if for all levels of directories in the sandbox, only for the one specified in the last argument, and if it doesn't find any in that directory it just says it hasn't found a match.

5-Regular Member
April 26, 2016

Juan,

Are you looking at creating a scoped sandbox?  You can specify file types that you want to pull into the sandbox, members with certain labels/revisions, etc.  If so, you can check the user guide, for the "Creating Sandboxes" section, and we go into "specifying the sandbox scope".  If I understand your inquiry correctly.