Skip to content

Instantly share code, notes, and snippets.

@artbristol
Last active March 24, 2023 04:54
Show Gist options
  • Save artbristol/e626f942b5c236631af7 to your computer and use it in GitHub Desktop.
Save artbristol/e626f942b5c236631af7 to your computer and use it in GitHub Desktop.
inotify watch a directory with timestamps
inotifywait --monitor --timefmt '%F %T' --format '%T %w%f %e' --recursive $1
@vuhuythanh1995
Copy link

The problem is that after more than 1 hour, inotifywait won't monitor that directory anymore, I have checked with the command ps -ef | grep inotifywait and can't see it running. How do I keep the service running until I turn it off?

@TaeBbong
Copy link

use & to run it on background
inotifywait -m /dir &

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment