Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
これは、スタック オーバーフローの最初の質問です。特定のディレクトリを監視するinotify互換のスクリプト作成が必要で、新しいファイル/フォルダーが作成された場合は、それらのファイルを別のフォルダーにコピーします。定期的に実行するのではなく、変更を常に監視するスクリプトが必要です。事前にサンクス。
ページinotifywaitからを使用して、このようなものを作成できます。inotify-tools典型的な用途:
inotifywait
inotify-tools
inotifywait -m /tmp | while read path events name; do echo "Now I am going to do something with $name in directory $path." done
inotifywaitの動作を制御するためのオプションはたくさんあります。詳細については、man ページを参照してください。