Created
          November 13, 2015 09:15 
        
      - 
      
 - 
        
Save YuzuruSano/3433bbf5a4478d9b595d to your computer and use it in GitHub Desktop.  
    【concrete5 5.7 + mamp想定】ローカルのapplication/以下をリモートにごそっとアップするサンプル
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/sh | |
| # sshpassコマンドが利用できること | |
| # --deleteオプションはお好みで | |
| #sshpass用のパスワード | |
| SERVERPASS='sshpassword' | |
| #除外ファイルを指定して纏める | |
| EXCLUDE=("/config/database.php" "/files/") | |
| for i in "${!EXCLUDE[@]}" | |
| do | |
| EXCLUDES[i]="--exclude=${EXCLUDE[i]}" | |
| done | |
| #転送先 環境に合わせて変更 | |
| TO="/your_concrete5/application" | |
| #転送元 自身の環境にあわせて変更 | |
| FROM="username@hostip:/your_remote_concrete5/application/" | |
| # まずはDRY RUNしてね | |
| sshpass -p ${SERVERPASS} rsync -avn --delete "${EXCLUDES[@]}" ${FROM} ${TO} | |
| # sshpass -p ${SERVERPASS} rsync -av --delete "${EXCLUDES[@]}" ${FROM} ${TO} | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment