Code Change Request

# 21848

Back to Code Changes

Christopher
Software Development
StableBit DrivePool
Public
Alex

So for this particular case, this is what was added:

dpcmd set-duplication-recursive

(type that in an Administrative command prompt to see help on usage)

Usage:

dpcmd set-duplication-recursive [parameter1 [parameter2 ...]]

Commands:

  set-duplication-recursive - Recursively sets the duplication count on one or more folders on the pool matching a pattern.
    poolFolderPath - A path to a folder on the pool.
    duplicationCount - The duplication count (>= 1).
    folderPattern - A full path pattern to match folders against (use ? and * or /regex/).

Examples:

C:\Users\Administrator>dpcmd set-duplication-recursive e:\ 1 *Sys*

dpcmd - StableBit DrivePool command line interface

Version 2.2.0.654

Setting duplication count recursively to 1 on '\\?\e:\':

Matching folder pattern '*SYS*':

Duplication count set to 1 on '\\?\e:\SysinternalsSuite\'.

C:\Users\Administrator>dpcmd set-duplication-recursive e:\ 1 /.*Sys.*/

dpcmd - StableBit DrivePool command line interface

Version 2.2.0.654

Setting duplication count recursively to 1 on '\\?\e:\':

Matching regular expression pattern '.*Sys.*':

Duplication count set to 1 on '\\?\e:\SysinternalsSuite\'.
Public
Alex

* [Issue #21848] Rewrote dpcmd.exe to accommodate for a more structured command module layout and added a bunch of new 
                 commands (requires command prompt with Administrative rights).
    - Added:
        - ignore-poolpart - Immediately disconnects a pool part from the pool and prevents it from participating in 
                            future pools by placing an ignore tag on it.
        - refresh-all-poolparts - Forces the re-enumeration of all the pool parts and pools.
        - remeasure-pool - Recomputes a pool's file usage statistics.
        - set-duplication-recursive - Recursively sets the duplication count on one or more folders on the pool matching a 
                                      pattern (regex or file pattern).
        - unignore-poolpart - Removes the ignore tag from a pool part, and re-adds it to the pool.
Public
Alex

Add the ability to set file duplication rules across many folders on the pool using folder name patterns (much like we have in file placement).
Public
Alex

Ok, that would be an interesting feature. Our folder duplication rules, right now, are stored inside of the actual folder that's being duplicated (as alternate streams).

I suppose what we can do is add a command line utility to toggle duplication level on a folder, and then it would be as simple as running a powershell script.

In fact, in 2.X we do have dpcmd right now, which can do just that. So all you have to do is type dpcmd set-duplication [path] [duplication count]

Just make sure to launch the command prompt as admin.