Created
March 15, 2017 16:05
-
-
Save burgiuk/4a17650d3b59f56a389d8302538249e5 to your computer and use it in GitHub Desktop.
Batch script to rotate PHP logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
SETLOCAL ENABLEEXTENSIONS | |
SET logPath=c:\php\logs\ | |
SET currentLog=PHP54_errors.log | |
FOR /F %%A IN ('WMIC OS GET LocalDateTime ^| FINDSTR \.') DO @SET B=%%A | |
MOVE %logPath%%currentLog% %logPath%%B:~0,4%-%B:~4,2%-%B:~6,2%.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment