emcrisostomo / fswatch

A cross-platform file change monitor with multiple backends: Apple OS X File System Events, *BSD kqueue, Solaris/Illumos File Events Notification, Linux inotify, Microsoft Windows and a stat()-based backend.
https://emcrisostomo.github.io/fswatch/
GNU General Public License v3.0
5.07k stars 330 forks source link

execute cmd for single filetype #318

Open t-lie opened 10 months ago

t-lie commented 10 months ago

Hi,

I getting in a problem using the exclude / include parameter. If I am using this line, all works fine: fswatch /data/webdav/data --event Created | xargs -I '{}' sh -c 'filename=$(basename ${1});cp $filename /data/compose/72/consume;rm $filename;' - {}

But if I use this one, no pdf file is recognized: fswatch /data/webdav/data --event Created -e ".*" -i ".*/[^.]*\\.pdf$" | xargs -I '{}' sh -c 'filename=$(basename ${1});cp $filename /data/compose/72/consume;rm $filename;' - {}

Can anyone help here? Is there any syntax issue?

Thanks!