Linux で Dropbox ドリブンなシステムを構築する方法Linux で Dropbox ドリブンなシステムを構築する方法

<< | コメント(0) | トラックバック(0) このエントリーを含むはてなブックマーク >>

Dropbox 便PC...

 Dropbox 使便



 

 Dropbox 

Dropbox ドリブンとは


Dropbox  Dropbox 

...

 PC Dropbox 

dropbox_driven.png
 

 twitter  URL  post Dropbox 

 txt11使

 

1, Dropbox 




Dropbox - Dropbox  - 

 



 250MB 

 

2,  Dropbox 


 Dropbox 



Dropbox - Dropbox  - 

 

CUI  CLI Script 

使

DropboxLinux - maruko2 Note.

 

3, inotifywait 


便 inotify-tools 

inotify-tools - GitHub

 GitHub 



 

4, 


inotifywait 

Linux  Dropbox inotifywait  'moved_to' 



 
 
#!/bin/bash

my_input_path="/home/test/Dropbox/target/"
my_script_path="/usr/local/script/"

# fileが移動してくるのを待つ
while inotifywait -e moved_to ${my_input_path}; do
   while true; do
       # 別のファイルを処理中の場合は待つ
       PID=`pgrep -f "{実行するコマンド}"`
       if [ -z $PID ]; then
          # zipファイルのリストを取得
          LIST=`ls ${my_input_path}*.{txt,html} 2>/dev/null | head -n 1`
          if [ -z "$LIST" ]; then
            # 無かったら出る
            break
          fi

          cd ${my_script_path}
          {実行するコマンド} "$LIST"
          //不要になったファイルを削除
          rm -f "$LIST"
       fi
       sleep 20
   done
done

 

 



(

 

mv

rm Dropbox  Web UI 

 

txt,html

 


Dropbox 

 使

トラックバック(0)

トラックバックURL: http://exe.tyo.ro/mt/mt-tb.cgi/1287

コメントする

2014年10月

      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

月別 アーカイブ

2014年
2013年
2012年
2011年
2010年
2009年
2008年
2007年