This section explains how to use the qq fs_walk_tree command.

Examples

To Recursively Add a New ACL with Multithreading

For this operation, you must run the qq fs_walk_tree and qq fs_modify_acl commands.

  1. Ensure that the jq tool is installed on your system.

  2. Run the qq fs_walk_tree command and use the --path flag to specify the path for the ACL. To extract the path for each item into an array, pipe the command to the jq tool. To modify the ACL for each path, pipe the command to xargs which in turn runs the qq fs_set_acl command on each path. For example:

    qq fs_walk_tree --path /my_path | \
      jq -r '.tree_nodes[].path' | \
        xargs -d '\n' -I % -n1 -P 4 \
          qq fs_modify_acl --path '%' \
            add_entry -t "DOMAIN\my_username" \
              -y Allowed \
              -r "Read" "Execute/Traverse" \
              -f "Object inherit" "Container inherit"
    

To Recursively Apply a Permissions Template

For this operation, you must run the qq fs_walk_tree and qq fs_modify_acl commands.

  1. Ensure that the jq tool is installed on your system.

  2. Use a new or existing file with the necessary permissions to capture the ACL and save it in JSON format by using the qq fs_get_acl command. For example:

    qq fs_get_acl --path /path_to_acl_source \
      --json >/history/new_permissions.json
    
  3. To apply the captured ACL, run the qq fs_walk_tree command and use the --path flag to specify the path for the ACL. To extract the path for each item into an array, pipe the command to the jq tool. To modify the ACL for each path, pipe the command to xargs which in turn runs the qq fs_set_acl command on each path.

    qq fs_walk_tree --path /my_target_path | \
      jq -r '.tree_nodes[].path' | \
        xargs -I % -n1 -P 4 \
          qq fs_set_acl --path '%' \
            --file /history/new_permissions.json >> &>/dev/null
    

To Recursively Modify SMB Attributes

For this operation, you must run the qq fs_walk_tree and qq fs_modify_acl commands.

Run the qq fs_walk_tree command and use the --path flag to specify the path for the ACL. To extract the path for each item into an array, pipe the command to the jq tool. To modify the ACL for each path, pipe the command to xargs which in turn runs the qq fs_set_acl command on each path.

qq fs_walk_tree --path /my_path | \
  jq -r '.tree_nodes[].path' | \
    xargs -I % -n1 -P 4 \
      qq fs_file_set_smb_attrs --path % \
        --hidden false

Description

Walk file system tree

Usage

qq fs_walk_tree [-h] [--path PATH] [--snapshot SNAPSHOT] [--file-only | --directory-only | --symlink-only] [--display-ownership | --display-all-attributes] [--output-file OUTPUT_FILE] [--max-depth MAX_DEPTH]

Flags

Flag Name Required Description
--path No Tree root path
--snapshot No Snapshot ID to read from
--file-only No Only display files
--directory-only No Only display directories
--symlink-only No Only display symlinks
--display-ownership No Display detailed owner and group information
--display-all-attributes No Display all attributes
--output-file No Output a file at the specified path instead of stdout
--max-depth No The maximum layers to traverse down the tree, starting from the path specified. For example, if the file tree is /dir/file, running the command with max-depth of 1 from root will yield / and /dir