xnotify icon indicating copy to clipboard operation
xnotify copied to clipboard

Can't get xnotify to do anything ...

Open ahmgithubahm opened this issue 5 years ago • 12 comments

I'm sure I must be missing something:

ak@rhino:~$ pwd
/home/ak
ak@rhino:~$ which xnotify
/usr/local/bin/xnotify
ak@rhino:~$ file /usr/local/bin/xnotify
/usr/local/bin/xnotify: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
ak@rhino:~$ xnotify --version
xnotify version 0.2.2
ak@rhino:~$ xnotify --include '.'

Then in another window:

ak@rhino:~$ pwd
/home/ak
ak@rhino:~$ touch testfile
ak@rhino:~$ rm testfile

but I get nothing from xnotify. This is a physical Ubuntu 18.04 (5.3.0-51) AMD64 server. Running with --verbose shows me a great list of everything it's going to watch under /home/ak, but nothing else, and nothing when I touch and then rm a file.

How can I help diagnose, or what am I doing wrong ? Thanks in advance.

ahmgithubahm avatar May 10 '20 16:05 ahmgithubahm

When you run the command with --verbose does it print the new file?

For example, after touch test.txt, here's what I get:

...
[xnotify] Watching: /home/vagrant/apps/dev/server/autorun/.git/COMMIT_EDITMSG
[xnotify] Watching: /home/vagrant/apps/dev/server/autorun/.git/HEAD
write test.txt

It might also be possible that you're watching too many files. So try it in a folder with fewer files. https://support.code42.com/CrashPlan/6/Troubleshooting/Linux_real-time_file_watching_errors

AgentCosmic avatar May 11 '20 02:05 AgentCosmic

Hi and thanks for the reply.

Nope, with --verbose, I do not get anything apart from the initial list of what it is watching ([xnotify] Watching: ...). That list only contains 584 files, so I hope that isn't above a limit. 😄

$ cat /proc/sys/fs/inotify/max_user_watches
8192

Seems normal.

ahmgithubahm avatar May 11 '20 09:05 ahmgithubahm

Can you verify that inotify works https://unix.stackexchange.com/questions/323901/how-to-use-inotifywait-to-watch-a-directory-for-creation-of-files-of-a-specific

AgentCosmic avatar May 11 '20 11:05 AgentCosmic

Hi. Yep, it seems to:

ak@rhino:~$ inotifywait -m /home/ak/
Setting up watches.
Watches established.
/home/ak/ OPEN,ISDIR
/home/ak/ ACCESS,ISDIR
/home/ak/ ACCESS,ISDIR
/home/ak/ CLOSE_NOWRITE,CLOSE,ISDIR
/home/ak/ CREATE jhdks
/home/ak/ OPEN jhdks
/home/ak/ ATTRIB jhdks
/home/ak/ CLOSE_WRITE,CLOSE jhdks
/home/ak/ DELETE jhdks

The output was while I ran an ls, a touch and them an rm in my home dir.

thanks

ahmgithubahm avatar May 15 '20 12:05 ahmgithubahm

I'm not sure what's causing the problem. I updated fsnotify to the latest version. Let me know if it works. https://github.com/AgentCosmic/xnotify/releases/tag/v0.2.3

AgentCosmic avatar May 15 '20 14:05 AgentCosmic

Hi there! I have the same problem. It worked for the first few minutes and then just stopped working. OS: MacOS Catalina 10.15.4

floodico avatar Oct 08 '20 13:10 floodico

Hi, is it the same exact error? It is v0.2.4?

AgentCosmic avatar Oct 08 '20 13:10 AgentCosmic

Hi, is it the same exact error? It is v0.2.4?

yes. I don't get any logs if i drop the files to the current directory. Only these logs were printed from time to time:

⇒  xnotify --client "55.55.55.5:8090" -i .
write .DS_Store
write .DS_Store

floodico avatar Oct 08 '20 13:10 floodico

xnotify can only watch existing files. You can use --verbose to get more detailed logging.

AgentCosmic avatar Oct 08 '20 14:10 AgentCosmic

Ok, i get that at the start. Screenshot 2020-10-09 at 11 41 36 And after that just nothing was printed.

xnotify can only watch existing files

So xnotify is not my option if i want to have event notifications about moving or copying files?

floodico avatar Oct 09 '20 09:10 floodico

We'll it depends. On Windows it will detect if I create new file with my editor or if I drop a file in explorer. But when I use explorer to create new file it doesn't detect. This just uses whatever the library (fsnotify) and OS provides. Maybe you can try using the cli to move the file and see if it triggers?

AgentCosmic avatar Oct 09 '20 09:10 AgentCosmic

Actually fsnotify events work strange on VM system in my case. Maybe it works like this because of SSHFS synced folder. My colleague described this situation in more detail here - https://github.com/adrienkohlbecker/vagrant-fsnotify/issues/33. So i thought that using xnotfy is the good solution to avoid 'incorrect' or 'not concrete' events of fsnotify.

floodico avatar Oct 09 '20 10:10 floodico