Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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...

share|improve this question
    
If no one gives an answer in a couple of days for a program/script. Then reply with a comment here (so I get a notification) and I can look into writing a quick script. I am a little busy today. –  Julian Stirling Dec 30 '13 at 12:31
    
@JulianStirling Ok friend sure i'll do. Thanks anyway –  Ask Dec 30 '13 at 13:09
    
@JulianStirling It seems no body can help.. When you have some time please help –  Ask Jan 1 at 8:45
    
Right, just to clarify you want a script to make an on screen notification every time someone changes a file in a folder? What do you want it to do if your pc is off? Bring up a list? Do you need to dismiss items when they are somehow tracked? –  Julian Stirling Jan 2 at 17:36
    
@JulianStirling I want a script to make screen notification every time someone changes a file/folder in a Shared folder. –  Ask Jan 3 at 7:39
add comment

2 Answers

up vote 4 down vote accepted

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.

share|improve this answer
    
Great, thanks man –  Ask Jan 3 at 12:38
add comment

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.

share|improve this answer
    
can you help me in incron –  nux Dec 31 '13 at 20:24
    
ty my friend , happy new year , just one other question how it will notify me ? –  nux Dec 31 '13 at 21:29
    
A message will appear in that window. However, the iwatch web page linked above shows other options if you want to consider them. And, OBTW, if an answer to your question is good, please click on the checkmark-on-circle icon at left to show it was good. You can change that later if a better answer comes up which meets your needs more directly. This also adds karma points to your rep. –  K7AAY Dec 31 '13 at 21:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.