Read NSS Rights to PDF File

0 Likes

Bash Script to read / collect trustees and inherited rights filter across multiple folder trees:



#OS : Open Enterprise Server 2 / SP1 or newer with Cluster Services

--require: included bash script 'read-rights.sh' --or-- in clustered env called 'read_nss_rights_to_folder' ; 'pdfvonascii'

---rpm packages:realpath-1.11-4.7; enscript; ghostscript-library-8.15.3-18.13 (SLES10)



Usage:


#reads-rights.sh



-fill the variables 'root_path' & 'dir_path' with folder(s) which you walk thru, 'dir_file_path' & 'dir_file_tmp_path' for output an temp / working folder



--> read & collect nss trusstes from multiple folder and thier child's



>>collected ASCII output convert to separate PDF file and write down in chronological order to an folder on any destination path <<



##############################################################################
#clustered env to run with cron:

1.) create on cluster resource/volume new path structure:
e.g. '/media/nss/DATA/system'
|-- etc
| |-- cron.d
| `-- sysconfig
|-- tmp
|-- usr
| `-- local
| `-- sbin
`-- var
`-- spool
`-- tmp

2.) put files in folders...
|-- etc
| |-- cron.d
| `-- read_nss_rights_to_folder #file 1 with crontab entry #
| `-- sysconfig
| `-- read_nss_rights_to_folder #file 2 with variable for file3#
|-- tmp
|-- usr
| `-- local
| `-- sbin
| `-- read_nss_rights_to_folder #file 3 script#
`-- var
`-- spool
`-- tmp

3.) modify cluster resource, load/unload script :
#load script
#################################################################
# Start extra Services associated with clustered NCP Pool/Volume#
#################################################################
MOUNT_POINT=/media/nss/DATA
SYS_PATH=$MOUNT_POINT/system

#################################################################
## script 'read_nss_rights_to_folder'
##read nss FS Trustee Rights and write the output to dedicated ##PDF-File in specified Folder...
#################################################################
## startscript to configure /etc/cron.d/read_nss_rights_to_folder
#################################################################

/usr/bin/test -f $SYS_PATH/etc/cron.d/read_nss_rights_to_folder && /bin/cp $SYS_PATH/etc/cron.d/read_nss_rights_to_folder /etc/cron.d/

/usr/bin/test -f /etc/cron.d/read_nss_rights_to_folder && /bin/chmod 640 /etc/cron.d/read_nss_rights_to_folder

#################################################################

#unload script / ! prior 'ncp.. stuff'
#################################################################
## stopscript to unconfigure /etc/cron.d/read_nss_rights_to_folder
#################################################################

if [ -f /etc/cron.d/read_nss_rights_to_folder ]; then
/bin/rm /etc/cron.d/read_nss_rights_to_folder
fi

#################################################################



ready...check function

Labels:

Collateral
How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended