2012年01月30日のつぶやき

0
    10:37
    みんなが大好きなJUGEMで、 ツイッター投稿をコミック風に表示できる 連携ができるんだよ
    • 2012.01.31 Tuesday
    • -
    • 03:01
    • -
    • -
    • -
    • -
    • by orz

    lsyncdでftpとか

    0

      lsyncdで、rsyncじゃなくて、FTPつかいたいなーとか、
      lsyncしたファイルの情報をdbにつっこみたいとかできないかと
      調べてたら、デフォルトのconfを修正すれば、出来そうな感ですた。

      サンプルのconfをコピーして、(yumでいれてるとこのへん)
      cp -p /usr/share/doc/lsyncd-2.0.4/examples/lbash.lua /etc/lsyncd.conf


      #cpコマンドを/home/ftpscript.shにかえただけですが、
      cpオプションと同じ動きをするように作ればいけるんじゃないでしょうかと。


      --------------------------------------------------------------------------------------
      -----
      -- User configuration file for lsyncd.
      --
      -- This example uses local bash commands to keep two local
      -- directory trees in sync.
      --
      settings = {
              logfile         = "/tmp/lsyncd.log",
              statusFile      = "/tmp/lsyncd.stat",
              statusIntervall = 1,
              nodaemon        = true,
      }

      -----
      -- for testing purposes. prefix can be used to slow commands down.
      -- prefix = "sleep 5 && "
      --
      prefix = "sleep 2 &&"

      -----
      -- for testing purposes. uses bash command to hold local dirs in sync.
      --
      bash = {
              delay = 0,

              maxProcesses = 1,

              -- calls `/home/ftpscript.sh  -r SOURCE/* TARGET` only when there is something in SOURCE
              -- otherwise it deletes contents in the target if there.
              onStartup = [[
      if [ "$(ls -A ^source)" ]; then
              /home/ftpscript.sh ^source* ^target;
      else
              if [ "$(ls -A ^target)" ]; then rm -rf ^target/*; fi
      fi]],

              onCreate = prefix..[[ /home/ftpscript.sh -r ^sourcePath ^targetPathdir]],

              onModify = prefix..[[ /home/ftpscript.sh  -r ^sourcePath ^targetPathdir]],

              onDelete = prefix..[[ /home/ftpscript.sh  -rf ^targetPath]],

              onMove   = prefix..[[ /home/ftpscript.sh  ^o.targetPath ^d.targetPath]],
      }

      sync{bash, source="/tmp/aaa", target="/tmp/"}


      --------------------------------------------------------------------------------------












      あなたの好きな四文字熟語!

      0
        あなたの好きな四文字熟語!

        焼肉定食

        疲れますね

        0
          JUGEMテーマ:コイケゲリオン大好き


          ぼくもいいとおもうんですよ

          mod_proxy_balancerの忘れやすい設定とか

          0

            balancermenberの設定で、retly,loadfactor,statusを設定した。
            忘れそうなので、メモ。

            loadfactor:バランサーの重みづけ
            retry:タイムアウト時のリトライ回数
            status:D=disabled,S=stopped,i= ignore-errors,H=hot-standby
            lbset:ロードバランサーのセット番号。複数セットを作成するときにあれこれ
            route:stickysessionを使用しなければとくにはいらなそうな感じかな


            試しに設定した感じで

            <Proxy balancer://cluster>
               BalancerMember http://*.*.*.*:8080 retry=3 loadfactor=10 status=D route=r1 lbset=1
               BalancerMember http://*.*.*.*:8080 retry=3 loadfactor=10 route=r2 lbset=1
               </Proxy>
               ProxyPass /hoge balancer://cluster/hoge timeout=2

            管理画面の画像とか

            koike.JPG




            1

            calendar

            S M T W T F S
            1234567
            891011121314
            15161718192021
            22232425262728
            293031    
            << January 2012 >>

            selected entries

            categories

            archives

            recent comment

            recent trackback

            recommend

            links

            profile

            書いた記事数:219 最後に更新した日:2022/09/09

            search this site.

            others

            mobile

            qrcode

            powered

            無料ブログ作成サービス JUGEM