Export ACLs to Excel File or any other file format.

nativ0

Cadet
Joined
Apr 27, 2023
Messages
3
I need a mechanism where it is possible to export to Excel or another format (PDF/Word) all user and group permissions in TrueNAS Scale, that is, the ACLs of all 21 datasets I have. If it's necessary to use third-party programs (Grafana, PB, etc.), it's not a problem.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Just the dataset mountpoints or every file within the datasets (because file ACLs do not necessarily match the dataset mountpoint). Former is trivial and part of our debug script. Latter is something where you will have monstrously large output. To illustrate:
Code:
root@truenas[~]# nfs4xdr_getfacl -n /mnt/dozer/SHARE | wc -c
393

So text output has 393 bytes multiply that by millions and you get lots of space in your spreadsheet. In theory you could reduce the space consumed by base64-encoding the actual xattr bytes
Code:
>>> len(base64.b64encode(os.getxattr("/mnt/dozer/SHARE", "system.nfs4_acl_xdr")))
172

But then you'd need more programming on your end to figure out what to do with it.
 
Last edited:
Top