Operating System - HP-UX
1752755 Members
5074 Online
108789 Solutions
New Discussion юеВ

Scripting audit log saves

 
SOLVED
Go to solution
Linda Card
Frequent Advisor

Scripting audit log saves

We have to save our audit logs (policy). I am not very good at scripting but I was thinking that daily I could create a directory with the date in the directory name and then just tar the /.secure/etc/ directory to the
"dated" directory. I could use root's cron to perform this process. Crude but hopefully effective. But I cannot find a reference to creating a directory with the date in the name.

Does anybody know how to do this?
mkdir audit-[today's date} ????

Linda
2 REPLIES 2
Sanjay_6
Honored Contributor
Solution

Re: Scripting audit log saves

Hi,

try

#/usr/bin/sh
TODAY_DATE=`/usr/bin/date +%m%d%Y`
DIR_NAME=audit-$TODAY_DATE
WORK_DIR=/some_dir_where_you_have_space

mkdir $WORK_DIR/$DIR_NAME

Hope this helps.

Regds
Linda Card
Frequent Advisor

Re: Scripting audit log saves

Sanjay,
Thank you. It worked great.

Linda