Operating System - HP-UX
1833289 Members
3104 Online
110051 Solutions
New Discussion

Assistance with auditor's request

 
SOLVED
Go to solution
Brent W. Moll
Advisor

Assistance with auditor's request

I've been asked by our auditors to provide them a listing of the following on an HP-UX 11.0 server:

A list of all programs/objects with ???Last Modified??? date in 2002.

A list of all data sets/objects with ???Last Modified??? date in 2002.

Is there a way to do this without taking up an entire day of doing ls -lt's ?

Thank you for your assistance.
3 REPLIES 3
Pete Randall
Outstanding Contributor

Re: Assistance with auditor's request

You need to study up on the find command and the -mtime option.

Pete

Pete
Steven E. Protter
Exalted Contributor
Solution

Re: Assistance with auditor's request

Here is some code, but you'll have to modify it.

It grabs a list of file that has not been modified for 7 days in the temp directory. It builds a file list.

You can direct this output to a file and cover any and all filesystems, if you wish.

Complete script is attached. It is an example of the mtime directive noted in the post above.


OLDEST=7# Save tmp files for 7 days
RemoveList=/tmp/$$.RmList
RemoveListLs=${RemoveList}.Ls
TmpDirs=/sag/etc/TmpDirs
ExceptList=/sag/etc/ExceptList
ExceptSed=${RemoveList}.Sed
sed -e '/^#/d' -e 's/[]#.*$//' -e '/^[]*$/d' -e 's;/;\\/;g' -e 's;^\(.*\)$;/\1/d;' ${ExceptList} > ${ExceptSed} 2>/dev/null



eval find ${TmpDirList} -type f -mtime +${OLDEST} -print | sed -f ${ExceptSed} > ${RemoveList} 2>/dev/null
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: Assistance with auditor's request

Hi:

For your files:

# touch -amt 200112312359 /tmp/myref1
# touch -amt 200301010000 /tmp/myref2
# find / \( -type f -a -newer /tmp/myref1 -a ! -newer /tmp/myref2 \) -exec ls -l {} \;

For SD objects:

# swlist -l fileset -a date|grep 2002

Regards!

...JRF...