En cours

script notification using inotifywait

here is the context : i am running this on a raspberry pi

i am watching a folder for when a new file is create ([login to view URL]).

i must then read that file and use it contents for mpg321 parameters.(play sound)

then i erase the file created and wait again for a new file .. and so on...

the file can be create very fast one after the other so the mpg321 run is background and then kill himself.

i have a small script already , but need to be completed if it can help.

here is for example the contens of [login to view URL]

[login to view URL]

[login to view URL] [login to view URL]

#! /bin/bash

while true; do

inotifywait -q -e create /home/watch/

rsult=$(cat /home/watch/[login to view URL])

cd /home/notification/

mpg321 -q $rsult

rm /home/watch/[login to view URL]


the goal of this script is to detect when a file is create by another programme read is contents and then use it like parameters to play a notification sound. my script alredy work , but when the file is create too fast i am skipping some play.


Compétences : Linux, Script Shell

En voir plus : create shell script, shell bash, example shell script, bash file, notification, linux bash script, bash script, create shell script linux, kill linux, linux bash shell, shell script watch file, kill bash script, script parameters linux, bash kill script, notification script using php mysql jquery, bash kill, run parameters shell script linux, raspberry mp3, linux shell parameters, raspberry linux

Concernant l'employeur :
( 5 commentaires ) parimaribo, French Guiana

Nº du projet : #6692158

6 freelances font une offre moyenne de 30 $ pour ce travail


Hi Naaseb, no problem at all, just award me when see my message. you have my mail too sendme a message when you want.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(5 Commentaires)

Hi, With such async communication, misses will happen. Do you have control over the code/program that creates the [login to view URL] file? There are two sync points here, one is the file creator and second one is the file c Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(33 Commentaires)

Hello, Can you explain the procedure step by step? like: 1) Wait for x file in y folder 2) ... I can make a c# script instead of shell script, the performance will be better.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(33 Commentaires)

Hi, naseeb18. I developed tools and scripts that the Development Team utilize it. I have a strong background in data processing and string manipulation using Perl, python, bash and scripting in General. I can start as Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(21 Commentaires)

I need to now "too fast" what does it mean. I can help you with a control of time input. if you have any question please don't hesitate to contact me.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(6 Commentaires)

Hi, I think you can separate the logic for event notification and play music so that the it can process event faster. I would love to help you handle this issue. Phuc

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(0 Commentaires)