アプリケーション・データのエクスポートおよびダウンロード

これらのスクリプトを使用して、アプリケーション・データをエクスポートした後、ローカル・ディレクトリにダウンロードします。

これらのスクリプトは、次の操作を実行します:

  • 環境にサインインします。
  • 指定したジョブを使用して、2セットのデータをバックアップします。
  • エクスポートされたデータ・ファイルをダウンロードします。
  • サインアウトします。

Windowsのサンプル・スクリプト

このスクリプトをコピーして、exportDownloadData.ps1を作成します。それをローカル・ディレクトリに保存します。
$inputproperties = ConvertFrom-StringData(Get-Content ./input.properties -raw)
$username="$($inputproperties.username)"
$passwordfile="$($inputproperties.passwordfile)"
$serviceURL="$($inputproperties.serviceURL)"
$exportFile1="$($inputproperties.exportFile1)"
$exportFile2="$($inputproperties.exportFile2)"
$exportDataJobName1="$($inputproperties.exportDataJobName1)"
$exportDataJobName2="$($inputproperties.exportDataJobName2)"

epmautomate login ${username} ${passwordfile} ${serviceURL}
epmautomate exportdata ${exportDataJobName1} ${exportFile1}
epmautomate exportdata ${exportDataJobName2} ${exportFile2}
epmautomate listfiles
epmautomate downloadfile ${exportFile1}
epmautomate downloadfile ${exportFile2}
epmautomate logout

Linux/UNIXのサンプル・スクリプト

このスクリプトをコピーして、exportDownloadData.shを作成します。それをローカル・ディレクトリに保存します。
#!/bin/bash
. ./input.properties
export JAVA_HOME=${javahome}
${epmautomatescript} login "${username}" "${passwordfile}" "${serviceURL}"
${epmautomatescript} exportdata "${exportDataJobName1}" "${exportFile1}"
${epmautomatescript} exportdata "${exportDataJobName2}" "${exportFile2}"
${epmautomatescript} listfiles
${epmautomatescript} downloadfile "${exportFile1}"
${epmautomatescript} downloadfile "${exportFile2}"
${epmautomatescript} logout

input.propertiesファイルの作成

次のいずれかをコピーし、環境の情報で更新することにより、input.propertiesファイルを作成します。exportDownloadData.ps1またはexportDownloadData.shが格納されているディレクトリにファイルを保存します。

Windows

username=exampleAdmin
passwordfile=examplePassword.epw
serviceURL=exampleURL
exportFile1=FILE_NAME.zip
exportFile2=FILE_NAME.zip
exportDataJobName1=JOB_NAME
exportDataJobName2=FILE_NAME

Linux/UNIX

javahome=JAVA_HOME
epmautomatescript=EPM_AUTOMATE_LOCATION
username=exampleAdmin
passwordfile=examplePassword.epw
serviceURL=exampleURL
exportFile1=FILE_NAME.zip
exportFile2=FILE_NAME.zip
exportDataJobName1=FILE_NAME
exportDataJobName2=FILE_NAME

表3-19 input.propertiesのパラメータ

パラメータ 説明
javahome JAVA_HOMEの場所。Linux/UNIXの場合のみ。
epmautomatescript EPM自動化の実行可能ファイル(epmautomate.sh)の絶対パス。Linux/UNIXの場合のみ。
username アイデンティティ・ドメイン管理者の役割も保持するサービス管理者のユーザー名。
password サービス管理者のパスワードまたは暗号化されたパスワード・ファイルの名前と場所。
serviceURL スナップショットを生成する環境のURL。
exportFile1およびexportFile2 データのエクスポート先のファイルの名前。
exportDataJobName1およびexportDataJobName2 データのエクスポートに使用するジョブ。

スクリプトの実行

  1. 前述の項のスクリプトをコピーして、exportDownloadData.ps1またはexportDownloadData.shを作成します。
  2. input.propertiesファイルを作成して、exportDownloadDataスクリプトが配置されているディレクトリに保存します。このファイルのコンテンツは、オペレーティング・システムによって異なります。表3-19を参照してください。

    このディレクトリの書込み権限があることを確認してください。Windowsの場合、スクリプトを実行できるよう、「管理者として実行」オプションを使用してPowerShellを開始する必要があります。

  3. スクリプトを起動します。
    • Windows PowerShell: exportDownloadData.ps1を実行します。
    • Linux/UNIX: ./exportDownloadData.shを実行します。