The intention is to automatically measure the total amount of read and write to each Disk from Power up to Shutdown,
and automatically capturing the totals at both Restart and Sleep.
Plus a Manual Query when I wonder how much of my SSD write life has been consumed by a failed installation
I found 6 GB had been done to my SSD because Windows ignored my redirection to an HDD
This shows the end result of three triggers
Code: Select all
19:57:56.42
19:57:57.80 23/07/2012 PENDING Shutdown Disk: #1: OCZ-VERTEX2 --
" Lifetime Compressed Wr.. 0 0 0 000000000100"
" Lifetime Writes from H.. 0 0 0 000000000080"
" Lifetime Reads from Ho.. 0 0 0 000000000300"
1: OCZ. Total Data Read : 141 MB, 171,354 MB since installation (23/05/2012)
1: OCZ. Total Data Write : 39 MB, 44,547 MB since installation
20:00:09.09
20:00:16.31 23/07/2012 Post Shutdown Wake-Up Disk: #2: OCZ-VERTEX2 --
" Lifetime Compressed Wr.. 0 0 0 000000000100"
" Lifetime Writes from H.. 0 0 0 000000000080"
" Lifetime Reads from Ho.. 0 0 0 000000000300"
2: OCZ. Total Data Read : 7 MB, 171,361 MB since installation (23/05/2012)
2: OCZ. Total Data Write : 2 MB, 44,549 MB since installation
21:18:53.70
21:18:54.98 23/07/2012 -Query- Disk: #2: OCZ-VERTEX2 --
" Lifetime Compressed Wr.. 0 0 0 000000000100"
" Lifetime Writes from H.. 0 0 0 000000000080"
" Lifetime Reads from Ho.. 0 0 0 000000000300"
2: OCZ. Total Data Read : 83 MB, 171,437 MB since installation (23/05/2012)
2: OCZ. Total Data Write : 28 MB, 44,575 MB since installation
Code: Select all
@echo off & SETLOCAL & SETLOCAL EnableDelayedExpansion & CD /D D:\HDSentinel\Stats\ & CLS
SET "T0=%TIME%"
::GOTO :SKIP
IF EXIST HDSentinel_report_*.TXT DEL HDSentinel_report_*.TXT
"C:\Program Files (x86)\Hard Disk Sentinel\HDSentinel.exe" /TXTREPORT
REN HDSentinel_report_*.TXT HDSentinel_report_X.TXT
:SKIP
SET "D_T=%TIME% %DATE%"
SET /P STATE=<CLOSING.TXT & ECHO(%*>CLOSING.TXT & if "%2"=="" ECHO(>CLOSING.TXT
SET "IDENT=---" & SET "DRV=" & SET "TOT=" & SET "VAL=0"
SET "NOW=PENDING %2" & IF "%2"=="" SET "NOW=%1"
SET LO=1001 & SET "in=HDSentinel_report_X.txt"
<%in% (
ECHO( %T0%& ECHO( %D_T% %STATE% %NOW%
for /f %%a in ('find /c /v "" ^< %in%') do (SET /A HI=LO-1+%%a)
for /L %%b in (!LO!,1,!HI!) do (
set "LN=" & set /P "LN="
set "XXX=!LN:~4,10!"
IF /I "!XXX!"==" PHYSICAL " (
SET "IDENT=!LN:~40,6!" & SET "DRV=!DRV! !IDENT! " & SET "OUT.TXT=!IDENT:~3!_Data_Report.txt"
(ECHO( %T0%& ECHO( %D_T% %STATE% %NOW% !LN:~32!)>> !OUT.TXT!
ECHO !LN:~33!
)
IF /I "!XXX!"=="TOTAL DATA" ECHO !IDENT!. !LN:~4,16! !LN:~53!
IF /I "!LN:~3,10!"==" LIFETIME" ( ECHO "!LN:~3,60!">> !OUT.TXT! & ECHO "!LN:~3,60!")
IF /I "!XXX!"=="TOTAL DATA" FOR /F "tokens=1-2 delims=:M" %%a IN ("!LN!") DO SET /A VAL=!VAL!+%%b
IF /I "!XXX!"=="TOTAL DATA" ECHO !IDENT!. !LN:~4,16! !LN:~53!>> !OUT.TXT!
)
)>> All_Data_Report.txt
TYPE All_Data_Report.txt
PAUSE
TYPE OCZ_Data_Report.txt
IF "%1"=="Wake-Up" (ECHO %DRV% R+W=%VAL%MB %D_T% %STATE%>> Wake-Up.txt) && TYPE Wake-Up.txt
ECHO(%2
PAUSE
IF "%2"=="Sleep" rundll32.exe powrprof.dll,SetSuspendState 0,1,0
IF "%2"=="Restart" Shutdown.exe -r -t 00
IF "%2"=="Shutdown" Shutdown.exe -s -t 00
EXIT /B
Under Configuration / Operations I have scheduled on all 7 days a Project "Report" to Start "After Load" with a "Time" delay of 00:00.
The Project type is "Run ... batch file"
The command Line includes the argument "Wake-Up", and is
Code: Select all
D:\HDSentinel\Stats\HDS_LOG.bat Wake-Up
HDS-LOG
D:\HDSentinel\Stats\HDS_LOG.bat -Query-
SLEEP
D:\HDSentinel\Stats\HDS_LOG.bat Post Sleep
RESTART
D:\HDSentinel\Stats\HDS_LOG.bat Post Restart
SHUTDOWN
D:\HDSentinel\Stats\HDS_LOG.bat Post Shutdown
Regards
Alan