25.08.2009, 21:03
I made an edit, with this improvement, you dont need to specify the path, just remember to put it in your server folder
Code:
@echo off Set ServerDirectory=%CD% set ServerName="samp-server.exe" for /f "tokens=1-3 delims=/- " %%a in ('date /t') do set XDate=%%a-%%b-%%c if not exist %ServerDirectory%\log mkdir %ServerDirectory%\log echo Daily log rotator for SA-MP Servers by KingJ echo Will rename the current log file to today's date (%DATE%) echo and place it in the log folder. echo. echo Path to use: echo %CD% echo. echo Ensure the server is not running. echo. echo This makes the server logs easier to manage echo. echo Stopping server... taskkill /f /im "%ServerName%" echo Renaming log file to server_log_%XDate%.txt rename %ServerDirectory%\server_log.txt server_log_%XDate%.txt echo Moving log to log folder... move %ServerDirectory%\server_log_%XDate%.txt %ServerDirectory%\log echo Starting Server... start %ServerDirectory%\%ServerName% echo. echo Log rotation complete