뱃치 파일을 생성합니다. 예를 들어 AuditExport.bat
에는 감사 데이터를 로컬 컴퓨터로 자동으로 익스포트하고 다운로드하는 다음과 유사한 스크립트가 포함됩니다.
@echo off rem Sample script to download and maintain 10 audit data backups rem Update the following parameters SET url=https://example.oraclecloud.com SET user=ServiceAdmin SET password=Example.epw SET AuditFileName="AuditBackup" SET NumberOfBackups=10 rem EPM Automate commands call epmautomate login %user% %password% %url% IF %ERRORLEVEL% NEQ 0 goto :ERROR call epmautomate exportAppAudit %AuditFileName% nDays=180 IF %ERRORLEVEL% NEQ 0 goto :ERROR call epmautomate downloadfile %AuditFileName%.zip IF %ERRORLEVEL% NEQ 0 goto :ERROR call epmautomate logout IF %ERRORLEVEL% NEQ 0 goto :ERROR rem Rename downloaded audit data backup, keep the last 10 backups Set Timestamp=%date:~4,2%_%date:~7,2%_%date:~10,2%% Set Second=%time:~0,2%%time:~3,2% ren %AuditFileName%.zip %AuditFileName%_%Timestamp%_%Second%.zip SET Count=0 FOR %%A IN (%AuditFileName%*.*) DO SET /A Count += 1 IF %Count% gtr %NumberOfBackups% FOR %%A IN (%AuditFileName%*.*) DO del "%%A" && GOTO EOF :EOF echo Scheduled Task Completed successfully exit /b %errorlevel% :ERROR echo Failed with error #%errorlevel%. exit /b %errorlevel%