[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Identificare file in lavorazione



On 22/09/2013 22:14, Mimmo wrote:
[...]
inotify-tools

[...] e’ interessante ma non mi mostra il nome del file, o almeno non sono riuscito a farglielo tirare fuori... :-(


Sul terminale lanci `inotifywait -mr tmp/` per la ricorsione e il monitoraggio (a te probabilmente servirà il deamon).

T1:
$ inotifywait -mr tmp/
Setting up watches.  Beware: since -r was given, this may take a while!
Watches established.

Su un altro terminale `cd tmp; touch noti.txt; rm noti.txt; echo ciao > noti.txt`. Allora su T1 (le righe vuote le ho aggiunte io):

tmp/ CREATE noti.txt
tmp/ OPEN noti.txt
tmp/ ATTRIB noti.txt
tmp/ CLOSE_WRITE,CLOSE noti.txt

tmp/ DELETE noti.txt

tmp/ CREATE noti.txt
tmp/ OPEN noti.txt
tmp/ MODIFY noti.txt
tmp/ CLOSE_WRITE,CLOSE noti.txt
^C

Ma se sei interessato al solo evento di modifica:
T1:
$ inotifywait -e modify -mr tmp/
Setting up watches.  Beware: since -r was given, this may take a while!
Watches established.
tmp/ MODIFY noti.txt
tmp/ MODIFY noti.txt

tmp/ MODIFY noti.txt
^C

Avendo lanciato sull'altro terminale `echo ciao>noti.txt; echo ciao >>noti.txt`

Ti faccio notare la doppia "modifica" per la redirezione '>' e la singola per l'aggiunta '>>'

Ciao Mimmo


--
Alessandro T.

R: Perché leggiamo dall'alto al basso e da sinistra a destra.
D: Perché dovrei iniziare la risposta all'e-mail dopo il testo citato?


Reply to: