Wednesday, May 8, 2024
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 1694  / 2 Years ago, tue, november 30, 2021, 5:12:33

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


More From » software-recommendation

 Answers
4

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.


[#27758] Wednesday, December 1, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
doredtness

Total Points: 153
Total Questions: 113
Total Answers: 106

Location: South Georgia
Member since Fri, Nov 13, 2020
4 Years ago
doredtness questions
Tue, Aug 2, 22, 15:45, 2 Years ago
Sat, May 21, 22, 05:26, 2 Years ago
Wed, Aug 24, 22, 11:09, 2 Years ago
;