SuprSurfr
Joined: 24 May 2007 Posts: 21
|
Posted: Fri May 25, 2007 5:32 pm Post subject: Archiving logs |
|
|
Is use this batch file to archive my logs from the previous day.
| Code: |
@echo off
setlocal
set Log=eq2log_CharacterName.txt
call :GetDate "%Log%"
goto :eof
:GetDate
Set Filename=%1
Set FileDate=%~t1
For /F "tokens=1,2,3 delims=/ " %%A IN ('echo %FileDate%') do Set ShortDate=%%A%%B%%C
mkdir "backups\%ShortDate%txt"
copy "%Log%" "backups\%ShortDate%txt\%Log%"
Del %Log%
exit |
This creates a Folder in the Backup directory with the name of the logfiles date, and copies the logfile to that directory and then deletes the original.
I play EQ2 so I named the .bat script rotate.bat and place it in the:
| Code: |
| C:\Program Files\Sony\Everquest II\Logs\SERVERNAME\ |
I created the backup Directory:
| Code: |
| C:\Program Files\Sony\Everquest II\Logs\SERVERNAME\Backup |
I then placed a shortcut on my desktop to rotate.bat
The script is setup to name the directory by the short date.
We do one raid per day, If you do more than one raid per day you would need to modify the script to include the hour.
I find it handy for archiving old logs incase something goes wrong and you need to reparse them.
| Description: |
|
| Filesize: |
36.01 KB |
| Viewed: |
1099 Time(s) |

|
|
|