How to copy APM log files by scheduling

  • KM03807670
  • 28-Apr-2021
  • 10-Jun-2021


In some cases, we have to copy log manually every 2 or 5 minutes for issue happens intermittent. instead of doing so, we could create a .bat file to run basing on windows schedule


How to create a file to copy sepecific log files automatically.




Follow steps below:


1. Create a .bat file

2. For example, we want to copy log file "alerts.rules.log"


@echo off

copy "C:\HPBSM\log\alerts\alerts.rules.log" "C:\HPBSM\Temp\alerts\alerts.rules.log"
ren C:\HPBSM\Temp\alerts\alerts.rules.log alerts.rules-%date:~4,2%-%date:~7,2%-%date:~10,4%_@_%time:~0,2%h%time:~3,2%m%time:~6,2%s%.log


3. you can custom to copy file you want by changing the content above