0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ubuntuでディレクトリの変化を監視する

Posted at

ubuntuでディレクトリの変化を監視するにはinotifywaitを使えばOK

インストール

sudo apt install -y inotify-tools

監視

${TARGET_DIRECTORY}を監視し続ける
inotifywait -r -m ${TARGET_DIRECTORY}

オプションの意味

$ inotifywait -h
	-r|--recursive	Watch directories recursively.
	-m|--monitor  	Keep listening for events forever.  Without
	              	this option, inotifywait will exit after one

参考

inotifywaitによるディレクトリの監視とスクリプト実行
Linuxでファイル・ディレクトリ監視を行う『inotify』

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?