Start to use inotifywait
This commit is contained in:
förälder
a54df36c2f
incheckning
30e136f3ea
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
MY_PATH="`dirname \"$0\"`" # relative
|
||||
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
|
||||
|
||||
YOU=$(ps aux --sort=+utime | grep ipfs | tail -n 1 | cut -d " " -f 1)
|
||||
IPFSNODEID=$(ipfs id -f='<id>\n')
|
||||
|
||||
#toWatch="$MY_PATH/../wallets_swarm/.$IPFSNODEID"
|
||||
toWatch="./test"
|
||||
|
||||
inotifywait -r -q -e create,close_write,delete -m "$toWatch" |
|
||||
while read -s -r directory event filename; do
|
||||
|
||||
## Action à réaliser lors du changement d'état de ce dossier
|
||||
## ipfs_swarm_wallets_refresh
|
||||
|
||||
echo "$filename $event in $directory !" # >> /tmp/g1sms.log
|
||||
|
||||
done
|
||||
|
||||
exit 0
|
Laddar…
Referens i nytt ärende