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
4,809
Reaction score
3,448
Credits
35,036
You can use auditd for that.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Staff online


Top