Erstellen Sie eine Batch-Datei (z.B. AuditExport.bat
), die ein ähnliches Skript wie das folgende enthält, um das Exportieren und Herunterladen von Auditdaten auf einen lokalen Computer zu automatisieren.
@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%