これらのスクリプトを使用して、環境から不要なファイルを削除します。
これらのスクリプトでは、次のステップが実行されます:
input.properties
で指定されたファイルを削除します。Windowsのサンプル・スクリプト
次のスクリプトをコピーして、removeUnnecessaryFiles.ps1
という名前のファイルを作成します。それをローカル・ディレクトリに保存します。
$inputproperties = ConvertFrom-StringData(Get-Content ./input.properties -raw) $username="$($inputproperties.username)" $passwordfile="$($inputproperties.passwordfile)" $serviceURL="$($inputproperties.serviceURL)" $file1="$($inputproperties.file1)" $file2="$($inputproperties.file2)" epmautomate login ${username} ${passwordfile} ${serviceURL} epmautomate listfiles epmautomate deletefile ${file1} epmautomate deletefile ${file2} epmautomate logout
Linux/UNIXのサンプル・スクリプト
次のスクリプトをコピーして、removeUnnecessaryFiles.sh
という名前のファイルを作成します。それをローカル・ディレクトリに保存します。
#!/bin/bash . ./input.properties export JAVA_HOME=${javahome} ${epmautomatescript} login "${username}" "${passwordfile}" "${serviceURL}" ${epmautomatescript} listfiles ${epmautomatescript} deletefile "${file1}" ${epmautomatescript} deletefile "${file2}" ${epmautomatescript} logout
input.propertiesファイルの作成
removeUnnecessaryFiles
スクリプトを実行するには、input.properties
ファイルを作成し、環境の情報でファイルを更新します。removeUnnecessaryFiles.ps1
またはremoveUnnecessaryFiles.sh
が格納されているディレクトリにファイルを保存します。
Windows
username=exampleAdmin passwordfile=examplePassword.epw serviceURL=exampleURL file1=FILE_NAME file2=FILE_NAME
Linux/UNIX
javahome=JAVA_HOME epmautomatescript=EPM_AUTOMATE_LOCATION username=exampleAdmin passwordfile=examplePassword.epw serviceURL=exampleURL file1=FILE_NAME file2=FILE_NAME
表3-8 input.propertiesのパラメータ
パラメータ | 説明 |
---|---|
javahome |
JAVA_HOME の場所。Linux/UNIXの場合のみ。 |
epmautomatescript |
EPM自動化の実行可能ファイル(epmautomate.sh )の絶対パス。Linux/UNIXの場合のみ。 |
username |
アイデンティティ・ドメイン管理者の役割も保持するサービス管理者のユーザー名。 |
password |
サービス管理者のパスワードまたは暗号化されたパスワード・ファイルの名前と場所。 |
serviceURL |
スナップショットを生成する環境のURL。 |
file1 およびfile2 |
環境から削除するファイルまたはスナップショットの名前。ファイルが送信ボックスにない場合は、ファイルのパスおよび名前を指定します。 |
スクリプトの実行
removeUnnecessaryFiles.ps1
またはremoveUnnecessaryFiles.sh
を作成します。input.properties
ファイルを作成して、removeUnnecessaryFiles
スクリプトが配置されているディレクトリに保存します。このファイルのコンテンツは、オペレーティング・システムによって異なります。input.propertiesファイルの作成を参照してください。
このディレクトリの書込み権限があることを確認してください。Windowsの場合、スクリプトを実行できるよう、「管理者として実行」オプションを使用してPowerShellを開始する必要があります。
removeUnnecessaryFiles.ps1
を実行します。./removeUnnecessaryFiles.sh
を実行します。