Hi, everyone
I would like to write ksh script in ksh (HP-UX), to audit any changes inside target directories.
My enviroment has many constrains, so I can only use ksh and cannot install
any 3rd party soft or command (include perl or other languages)
The script functions like below
1) take a snapshot of the target directory (recursive with the directory inside, like ls -ailR target_dir)
2) log any changes(compare with snapshot) that been added, deleted or modified(include chmod) and seperatly store into log.add, log.del, log.mod
3) this script will excute in crontab once a day
note: maybe could use the cmd "dircmp" to compare two directories, but it's hard to make the snapshot if the directory size is huge
I've already search the related articles both in forum and google.
I do find something ... but due to the constrains of my enviroment,
it's far from complete the goal to finish the script (new to ksh, used to coding in perl)
There's an article https://www.unix.com/shell-programmin...-if-found.html
is closely to my requirement but still long way to go, hope someone can help to complete this script
I'll be very appreciate the effert you've done.
Thanks in advanced.
Stev.H
Thanks to the original author Steven Koh(id : izy100)
I've modified the code as follow
Hi,
I have used the command
cat * | grep -r <<String>> *
It returns:
cat : JAN : is directory
***********************
*********************
My directory structure:
log
- JAN
-catalina.out
-FEB
-catalina.out
-MARCH
... (11 Replies)
Dear All
When I start the AIX(6100-06)audit subsystem.
the log will save in /audit/stream.out (or /audit/trail), but in default when /audit/stream.out to grow up to 150MB.
It will replace the original /audit/stream.out (or /audit/trail).
Then the /audit/stream.out become empty and... (2 Replies)
Hi All,
Is there any way to monitor a command inside shell script ? I have a script inside which I have a tar command which zips around 200GB data.
tar zcvf $Bckp_Dir/$Box-BaseBackup-$Day.tar.gz * --exclude 'dbserver_logs/*' --exclude postmaster.pid --exclude 'pg_xlog/*'
I want to... (3 Replies)
Hi,
Im facing a problem that im stucked,
I have the following structure:
thales@pereirtc-vbox:/home/VfARM$ ls
code config doc lib manifest.bak manifest.rel manifest.v3 ns pub
if i try to execute zip -q -o arm.zip VfARM/* it will create a zip file with the folder VfARM.... (2 Replies)
Hi,
I need to write a directory monitor, i.e. a korn shell script which would
Report changes to the directory contents, like:
added file1,
deleted file2,
updated file3 ,
created subdir (optional)...
There is no specific file pattern.
So far I have written a little script... (1 Reply)
Hello all,
Can anyone please guide / help me in the following task....
I have a directory where some external users will upload pdf files. The filename of these pdf will be of a particular format (<id>-<first name>_<last name>_<some number>.pdf)
I want to make a script such that it takes... (6 Replies)
I'm am looking for a cheap way to trigger a script when a new file is written in a specific directory. AIX 5.3. It is a production system, so no kernel patching (i.e. inotify).
Filemon and audtiing are too expensive.
Thanks in advance. (2 Replies)
What is the best way for a script to run to monitor a directory for the presence of files and then perform a function afterwords? I was hoping to have it continually run and sleep until it detects that files are present in the directory, then break out of the loop and go on to the next step.
... (17 Replies)
hii,
I have to create a directory under the same directory with the date +%a extension like this
BackupLocation=$BackupLocation/$BackupLocation$(date +%w)
but the problem is ---
if backuplocation is abc/dfg then accroding to the above statement it would be
abc/dfg/abc/dfg5
but i... (6 Replies)
Hi Bosses!
I have a directory name sih. that directory contains some more directories and some files. i just want to list (ls) the directories under this directory. What will be the command.I am using debian linux.
Thanks bosses.will appreciate your help.
sih (6 Replies)