2

The situation is:

I have a shared directories from many other machines where other users work on.

I need to be notified whenever a user create, modify or delete a directory or file from his local directory which I share using smb...

It looks like the folder actions in the MAC systems..

Is there a software that do that?!

If there is no such application, any help in writing a script for that is appreciated..

Thanks in advanced...

Maythux
  • 87,123

2 Answers2

5

OK, first install inotify:

sudo apt-get install inotify-tools

Then make a new script on your computer named whatever you want (filename.sh) and paste in:

#! /bin/bash

folder=~/random/test

inotifywait -m -q -e delete -e create -e move -e modify -r --format '%:e %w%f' $folder | while read file
  do
    zenity  --title="Modifaction" --text "$file" --info&
  done

Modify the folder to the one you want, save, and then exit.

Make the file executable:

chmod +x filename.sh

And then you should be ready to rock.

1

You may use iwatch to watch a specific folder (directory) which itself relies on inotify (inode notify), a subsystem in the Linux kernel which extends filesystems to notice changes within them, and report those changes to applications.

Download it from http://ftp.debian.org/debian/pool/main/i/iwatch/ then once installed, open a terminal window and run

iwatch /folder

where /folder is changed to the directory you want to watch.

K7AAY
  • 17,705