Google Driveでinotify-toolが利用できないか試しました
1.概要
inotify-toolのinotifywaitをGoogle Driveで利用できないかと考えて試してみました。inotifywaitのオプションを設定して、リカーシブに検知を設定してもGoogle Driveでは検知できません。しかし、単一ファイルならば検知できました。その内容を記述します。
2.詳細
inotifywaitには、-rのオプションを設定することでリカーシブに検知できます。これはLocalPCで確認をしました。そこで、Google DriveをGoogle-drive-ocamlfuseでmountして、リカーシブに検知できないか期待して試しました。
(a) Google Drive mount
google-drive-ocamlfuse ~/sharedrive
(b) ファイル検知設定
inotifywait -m -r ~/sharedrive -e close_write |
while read -r directory action file
do
echo "$directory, $action, $file"
done
検知用shell(test.sh)を実行します
sh test.sh
Setting up watches.
Watches established.
と表示されて止まります。
別のterminalを開いて、何かファイルを作成します。
cd ~/sharedrive
touche test.txt
しかし、検知されません。
(c) 1つのファイル検知試験
inotifywait -m ~/sharedrive/testfile.txt -e close_write |
while read -r directory action file
do
echo "$directory, $action, $file"
done
検知用shell(test.sh)を実行します
sh test.sh
Setting up watches.
Watches established.
と表示されて止まります。
cd ~/sharedrive
touche testfile.txt
これは検知できました。機能しているようです。
所見
理由はわかりませんが、大量なファイルが保管されているGoogle Drive全体の検知は難しいようです。
参考
[本ブログ内参照]
・ファイル作成を検知するinotify-toolsを試しました
・Google driveのアクセス方法の試験 google-drive-ocamlfuse編
コメント
コメントを投稿