On 07/10/13 11:21, Alan McKinnon wrote:
On 09/07/2013 18:54, Joseph wrote:
How to design a sticky note pop-up when file is present?

I would like to check if file is present via and open a terminal window
with a simple message.
I think a simple bash script and a cron job would do the trick or is
there a better solution?

I've tried cron + bash script

cron:
32 10 * * * sh /home/joseph/xp_share/wall.sh

wall.sh
terminal
wall file ready

When I open terminal and type: "terminal" new windows pops up
But if close all the terminals and run wall.sh script the terminal will
not open.
I get an error message: (terminal:24945): Gtk-WARNING **: cannot open
display:



You want inotify for this.

You are polling something to discover if it's there, what yu really want
to do is let the kernel notify you when the event you are interested in
occurs.

There are many tools out there that interface with the kernel's inotify
system.


--
Alan McKinnon
alan.mckin...@gmail.com

Thanks Alan, yes I'm looking into it and your are the second person who suggested to me 
"inotify" is the tool for the job.
I've installed inotify-tools but I think I will need to find more samples to 
make it to work :-)

I just want to monitor one file in a directory.
I usually copy the file over the network to another computer (same file name) 
I'll overwrite the file.

Once I copy the file, the system should notify a use that new file exist (a message pop-up). If the use closes the message and will not open the file, after few ours I want to remind the user that the file has not been open yet.

Will it be very complicated to write a bash script like this?

--
Joseph

Reply via email to