exp-dist-audiolog/system/inotifywait-watcher/watcher.sh
Dooho Yi 2df1976407 changed runtime user 'syncthing' -> 'nextcloud'
- we want to keep the data folder /media/storage which is owned by 
nextcloud user. btw, the python code is owned by syncthing user but that 
is also available to the www-data group so nextcloud user already has 
full access.
2021-10-06 00:52:32 +09:00

25 lines
535 B
Bash
Executable file

#!/bin/bash
#set minimal required path
export PATH=$PATH:$HOME/.local/bin
#load pyenv of 'nextcloud' user
export PYENV_ROOT="/home/nextcloud/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
eval "$(pyenv virtualenv-init -)"
#load env for the proj. 'exp-dist'
pyenv shell exp-dist
#change directory
cd /home/yunohost.app/syncthing/Sync/exp-dist-audiolog
#start to watch..
./run.sh
while inotifywait -e modify,move,delete,close_write -r ./data/ ; do
./run.sh
done