ONTAP Discussions

Native fPolicy file blocking with RegExp

BerndS
3,233 Views

Hello,

 

I'm searching for a documentation and/or explanation, how to use RegExp in native fPolicy file blocking. My customer wants to block double file extentions (like <filename>.cad.11, <filename>.cad.08, ... )

 

 

 

One valid RegExp for this could be

 

\.cad.[0-9]+?$

which will find this pattern at the end of a filename.

 

With
 

vserver fpolicy policy scope create –vserver <vserver name> -policy-name <Policy Name> -file-extensions-to-include <RegExp>


I can set the file extensions to match (after doing all the other setup requiered) and it is written, that it is possible to use regexp here.
 
How do I add this to the command parameter -file-extensions-to-include? I tried some variations and they don't work (like putting "", '' around), but all ended up with an error 😞
 
I was not able to find any documentation on that topic, so if someone has found something which I can handoff to the customer?

2 REPLIES 2

zacharyt
3,100 Views

To include charachters such as "?" in the command you can use the command "set -active-policy false", then set it back to true after your done.

dadan
2,988 Views

Similar thing over here.

 

I want to native file block a extension with double extension like "filename.aaa.bbb" with folicy. I tried to masquerade the dot, but nothing helped (\.aaa\.bbb). * or ? seem to not match for dots (periods).

 

So how to block double file extensions? We´re using Clustered Data Ontap 8.3P2.

Public