Log new directories (created in a certain place) in a file

MechWright

New Member
Joined
Jun 2, 2020
Messages
4
Reaction score
1
Credits
52
Hi all!

I need to do the following:

Monitor a certain directory (for example, /media/server/ ) for new directories being created.
If a new directory is created, it should be written in a log file.

The goal is to create a system (using cron), which periodically checks whether new directories are created
and if yes, does some magic to them (this I know how to do).

I checked watch and tail, but failed to do what I want.
 


f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,578
Reaction score
4,151
Credits
40,729
You can use auditd for that.
 
MALIBAL Linux Laptops

Linux Laptops Custom Built for You
MALIBAL is an innovative computer manufacturer that produces high-performance, custom laptops for Linux.

For more info, visit: https://www.malibal.com


Top