Author |
Message |
KenMathers
Joined: 03 Apr 2008 Posts: 4
|
Posted: Thu Apr 03, 2008 4:19 am Post subject: SMART not stopping backup. |
|
|
I've set up the global_start.bat file to run smartctl.exe.
I have a disk that I know is dodgy so I set the smartctl.exe to check it before running the backup. (Although neither the source or destination is on the dodgy disk)
The backup profile is launched by VVLauncher.
When I look at the log file I see that it clearly ran the script and the script reported that the disk will fail within 24 hrs.
But the script also says that it gave an exit code of zero and the script continued.
I'm using ViceVersa Pro 2 Build 2014 and I just downloaded the global_start.bat and smartctl.exe from this forum today.
Any ideas?
2008-04-03 16:42:30 : SMART support is: Enabled
2008-04-03 16:42:30 : === START OF READ SMART DATA SECTION ===
2008-04-03 16:42:30 : SMART overall-health self-assessment test result: FAILED!
2008-04-03 16:42:30 : Drive failure expected in less than 24 hours. SAVE ALL DATA.
2008-04-03 16:42:30 : Failed Attributes:
2008-04-03 16:42:30 : ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
2008-04-03 16:42:30 : 5 Reallocated_Sector_Ct 0x0033 001 001 010 Pre-fail Always FAILING_NOW 2460
2008-04-03 16:42:30 : End Script Output
2008-04-03 16:42:30 : Script return code: 0
2008-04-03 16:42:30 : Checking source C:\Change_Address\ ... |
|
Back to top |
|
|
TGRMN Software Site Admin
Joined: 10 Jan 2005 Posts: 8763
|
Posted: Thu Apr 03, 2008 10:59 am Post subject: |
|
|
Hi, the manual for the smartctl.exe program says
Quote: | RETURN VALUES
The return values of smartctl are defined by a bitmask. If all is well
with the disk, the return value (exit status) of smartctl is 0 (all
bits turned off). If a problem occurs, or an error, potential error,
or fault is detected, then a non-zero status is returned. |
If you run the smartctl.exe command on the drive without using ViceVersa does it return the right code ?
Are you using Windows 2000 ? (I know there could be a problem with return codes on Windows 2000)
thanks _________________ --
TGRMN Software Support
http://www.tgrmn.com
http://www.compareandmerge.com |
|
Back to top |
|
|
KenMathers
Joined: 03 Apr 2008 Posts: 4
|
Posted: Thu Apr 03, 2008 8:16 pm Post subject: Bat file needs modifying |
|
|
OK. I'm not a programmer so I only stumbled on this by accident following your question. You asked what the exit status is when I run the script outside ViceCersa. And when I ran it (global_start.bat) as supplied, I had no way to know. So I added lines at the end of the script:
echo %ERRORLEVEL%
Pause
And this showed the error code as 24.
But it occured to me that VV would not see that code and after google'ing I found that the script needs to pass that errorlevel out when it exits. (Obvious to all you programmers out there but not to Joe Blogs on the street)
So the solution was to add the following (after removing my test lines) to the global_start.bat that I downloaded from your web site:
Exit %ERRORLEVEL%
Now the Backup stops as expected and the log file shows:
2008-04-04 09:06:21 : End Script Output
2008-04-04 09:06:21 : Script return code: 24
2008-04-04 09:06:21 : [ERROR] Script "C:\Program Files\ViceVersa Pro 2\GlobalScripts\Global_start.bat" returned an exit code not equal to 0. Stopping execution.
2008-04-04 09:06:21 : Exit Code: 2. Execution not completed. [ERROR]
2008-04-04 09:06:21 : ************************************************************
2008-04-04 09:06:21 : END ID: 20084320621-1702488-4940
Problem solved... |
|
Back to top |
|
|
TGRMN Software Site Admin
Joined: 10 Jan 2005 Posts: 8763
|
|
Back to top |
|
|
pb
Joined: 04 Sep 2007 Posts: 32
|
Posted: Thu Apr 24, 2008 10:43 pm Post subject: |
|
|
TGRMN Software wrote: | thanks for checking this! We will update the SMART script with echo %ERRORLEVEL% |
TGRMN: Note that echo %ERRORLEVEL% will only alert the user; apparently you need exit %ERRORLEVEL% to return the exit status to the prog.
Also note that there are newer versions of the smartctl program available.
--peter |
|
Back to top |
|
|
TGRMN Software Site Admin
Joined: 10 Jan 2005 Posts: 8763
|
|
Back to top |
|
|
|