Error Handling in Unattended Mode

Discussion in 'Paragon Drive Backup Product Line' started by DrumMemory, Jun 17, 2010.

Thread Status:
Not open for further replies.
  1. DrumMemory

    DrumMemory Registered Member

    Joined:
    May 28, 2010
    Posts:
    26
    Newbie question -- What do the disk backup programs do to notify me if an error arises during a scheduled (unattended) backup? The error code is presumably retained in the logs, but do I get some direct notification that the run did not succeed? I'm interested in both what DB10 Pro and BR Free 10.2 do.

    Thanks!
     
  2. Paragon_Tommy

    Paragon_Tommy Paragon Moderator

    Joined:
    Aug 10, 2009
    Posts:
    918
    In the professional and server edition, you have email notification settings that can send fail or successful backup operations status.
     
  3. DrumMemory

    DrumMemory Registered Member

    Joined:
    May 28, 2010
    Posts:
    26
    Is email notification the only consistent or reliable form of notification? I've seen DB10 Pro create a pop-up window under at least one failure mode (script error). Can any one tell us in what cases it does do something like this and in what cases it doesn't use this mechanism?

    For the record, the free version does not support the email option.
     
  4. JosephB

    JosephB Registered Member

    Joined:
    Jan 3, 2008
    Posts:
    310
    DrumMemory,

    In DB10 Pro, when you Schedule your backup image operation, it includes Error Checking (of non-zero return codes) in the script it generates for scheduling.

    .... (If you use instead the "Generate Script", it actually gives you the option to turn off the default of including error checking, although I see no reason why you would typically want that).


    P.S. If you backup your image to an external usb drive, you can test this , by turning "off" your external usb drive and let the scheduled backup execute.
    When your scheduled backup script executes it will end with an error (pop-up window) because external drive is not available for writiing to. As a matter of fact, if you look at windows task scheduler, you will see the scheduled script that executed and the non-zero return code will also be displayed there under the "Last Result" Column.


    Hope this helps you !
     
  5. DrumMemory

    DrumMemory Registered Member

    Joined:
    May 28, 2010
    Posts:
    26
    There are at least four ways to look for errors from a run of a backup task:
    1. Email notification (DB10 Pro and Server only)
    2. Paragon's log
    3. Windows' Task Scheduler history (if enabled)
    4. Presence or absence of the backup files!
    I am interested in what is reliable for use with an unattended system, of course with all error checking turned on. One of my boxes serves as a file server, a repository for back up files and a DVR. I rarely log into this box, but I want it to back up its system partition and a critical data partition onto a second disk daily and I want to know whenever it fails to do so. Only the email notification scheme really seems to do the job (an argument for investing in the PRO version).

    Here is a bit of history of three different kinds of errors I have encountered in my short experience with DB10 on two PC's, to explain how the errors appear in the various forms. Some of the reports can be misleading!

    1. Error caught by Windows: One of my jobs started failing repeatedly with 0xc0000005 access violation problems. (DB10 seems to have problems with backing up Windows 7 MBR's.) This manifests itself with the error number noted explicitly in the task scheduler history and the absence of either an email or of the expected backup files. However, the DB10 log indicates that the run succeeded -- the log reports the last step finished, which was successful. Seeing the error from the DB10 log requires realizing that the number of steps is wrong.
    2. Error caught by DB10 while applying operations. A job was unable to read a file. This resulted in an (undocumented) error number in the DB10 log and in its email and absence of expected files. However, the task scheduler reports only that the task timed out -- it probably opened an error window that no one ever had a chance to see. (Paragon -- it would be nice to know which file caused the problem, especially if the error repeats itself.)
    3. Error caught by DB10's scripting engine before applying operations. As noted in another of my threads, a script on a machine with multiple hard drives may fail due to Windows' randomly changing the numbering of the drives. In my case, this resulted in the script engine catching in its preprocessing that the now incorrectly referenced drive didn't have a third partition. The script engine raises an exception and opens an error window. But the task eventually times out. The DB10 log shows that the virtual tasks succeeded. You have to look closely to see that they weren't applied. The task scheduler shows that the task timed out. (If a human closes the error box, task scheduler reports the correct error.) The back up files for that date of course don't exist. The email notification fails to report in when the task times out, perhaps because it is described as reporting on applied operations and none are applied. I know that a problem occurred. But none of these mechanisms give me any information about what the error is until I actually run the job at a time when I can see the error window.
     
  6. JosephB

    JosephB Registered Member

    Joined:
    Jan 3, 2008
    Posts:
    310
    DrumMemory,

    Very interesting (and disturbing) and based on what you experienced, I also would consider it to be a problem/issue that under certain situations that timed out error box message displays prevents windows task scheduler, from getting the real error code !


    .... Paragon_Tommy,
    So, my question then, for Paragon_Tommy, based on your experiences is:

    I am wondering if there is a "Switch value" that can be added to the scripts.exe command-line or a keyword that can be entered into the script file, to tell the running script when an error is encountered *not* to display an error message box, but just exit the script with the error code (so that windows task scheduler gets the proper error code and so that no user intervention is required to respond to the error message box) o_O

    (P.S. DrumMemory, ....I would hope that if the above exists, it might address at least your issues 2, 3).
     
  7. JosephB

    JosephB Registered Member

    Joined:
    Jan 3, 2008
    Posts:
    310
    DrumMemory,

    Okay, I just stumbled across and found the scripts.exe, Switch value to tell the running script when an error is encountered *not* to display an error message box, but just exit the script with the error code (so that windows task scheduler gets the error code and so that no user intervention is required to respond to the error message box.

    Here it is:

    1. Go to Windows Task Scheduler (based on Win XP - Task Scheduler) and right click your DB10 Pro - Script, choose "properties".

    2. In the "Task" Tab, scroll through the "Run" command-line field and Delete the Switch value --graph (note, leave 1 blank space between the --alternate and --multiple switches, after you delete the --graph switch which is sandwiched between the two of them).

    Notes:
    .... By removing the --graph switch, the script will now run in Non-Graphical/GUI Mode which means character/console output window mode.
    So now no user intervention is needed and error code should be returned immediately to windows task scheduler and error message(s) writtten to windows command prompt/console window.

    .... Windows XP - Task scheduler does not have an option to view what was written the console/command window which is one of the reasons why I don't run my jobs/tasks with the Windows XP - Task Scheduler. I use a 3rd party task scheduler/automation tool which can capture the console window output and write it to a common job /task log file for my review.
    ... Alternatively, scripts.exe has another switch where you can get it to write the error messages to a log file for you, when you run it under windows task scheduler. Switch is -o and will write console error/info messages to file psi.out.


    BTW, I would be interested in knowing, if this ends up resolving your issues 2 and 3.

    P.S. Also, 3rd party task scheduler/automation tool that I use has option to send emails which you can setup to send out should an executed script end with a non-zero error code (this could possibily be at least a workaround for your issue 1, where at least you can get an email message upon non-zero exit code from the script, but of course does not resolve why you are getting the error. If your interested in the name of the 3rd party task scheduler/automation scripting tool that I use, let me know.
     
    Last edited: Aug 8, 2010
  8. DrumMemory

    DrumMemory Registered Member

    Joined:
    May 28, 2010
    Posts:
    26
    Joseph,

    Thank you for the pointers. :thumb: The third situation is easy to reproduce; I'll try it out in the next couple of days. Unfortunately the first situation (0xc0000005 error) is now arising in a new way and I've got to find out what will keep it away. The second situation isn't reproducible, so we'll just have to wait until something similar arises.

    Where have you found the documentation of the command line switches or arguments? The only document I have is the script language document. It documents the -o option, which functions like a normal Unix -o argument (-o filename specifies the name of the output file; -o by itself defaults to psi.out, as you mentioned.) It does not describe the --graph option, or two of the other three command line arguments.

    In reference for other users, in Windows 7 the task command line is found in the "Action" tab after selecting the specific task and selecting properties after right-clicking. The details of the "action" are only fully viewable or changeable by clicking "edit" after selecting the action within the task (typically only one action to choose).
     
  9. JosephB

    JosephB Registered Member

    Joined:
    Jan 3, 2008
    Posts:
    310
    DrumMemory,

    I opened a command prompt window and changed directory to the Paragon program folder containing "scripts.exe" and executed scripts.exe --help.

    .... Looks like help is more uptodate than manual documentation.
     
  10. DrumMemory

    DrumMemory Registered Member

    Joined:
    May 28, 2010
    Posts:
    26
    JosephB,

    Thanks for your suggestions. Unfortunately neither works for me.
    • Regarding --graph: It changes the window that opens from being a GUI to a console style window. But it doesn't suppress opening another window. Worse, this seems to shut off email notification, definitely not something you or I intended!
    • Grabbing the output of --help: on Windows 7 this switch creates a new console window that flashes by and disappears. Neither -o or redirecting either stdout or stderr captures the output in that window. Please post what you get on XP!
    Oh well, I still like the direction you suggested. But I think we need someone from inside Paragon to help clarify the situation.

    Again, thanks.
     
  11. JosephB

    JosephB Registered Member

    Joined:
    Jan 3, 2008
    Posts:
    310
    DrumMemory,

    1. What other Window opens up ? Do you have confirm off in your script file ?

    2. Scripts.exe switches:

    Usage: scripts.exe [parameters]
    Parameters:
    <input file> - Specifies input file. (Default: psi.in).
    -h, --help - Shows this screen and exits.
    -v, --version - Shows version number and exits.
    -g, --graph - Specifies to run scripts in graphical mode.
    -s, --silent - Silent output (Without any warnings).
    -x, --expert - Expert mode (use with caution).
    -n, --nochs - Don't use CHS geometry.
    -e, --ebios - Use EBIOS.
    -p:<parameter>=<value> - Specifies parameter (decimal) for script.
    -s:<parameter>="<value>"- Specifies string parameter for script.
    -Wno - Disables all warnings.
    -errnum <number> - Specifies number of errors will be displayed.
    -o <output file> - Specifies output file. (Default: psi.out).
    To turn off writing output file, use: -o none
    --verbose - Verbose (exteneded) output.
    --input "<script>" - Specifies script from command line.
    --cdbe - Enable CD/DVD burn emulator.
    --dontchecklocks - Disable check for locked partitions.
    --forcereboot - Forced reboot (use with caution).
    --rebootonconfirm - Reboot only on confirmation.
    --multiple - Enable multiple stub instances.
    --cutprogress - Output progress info in reduced format.
     
  12. DrumMemory

    DrumMemory Registered Member

    Joined:
    May 28, 2010
    Posts:
    26
    JosephB,
    1. The windows that opens contains the progress data, but in a form that closely resembles the command line interface. It disappears when the job ends, just like the GUI version. Yes, confirm is set to "off".
    2. Thank you for the list. The switches set by DB10's scheduler are "-Wno --alternate --graph --multiple". Even with your --help output, we still don't have any documentation for "--alternate".
     
  13. JosephB

    JosephB Registered Member

    Joined:
    Jan 3, 2008
    Posts:
    310
    DrumMemory,

    Regarding --graph: It changes the window that opens from being a GUI to a console style window. But it doesn't suppress opening another window. Worse, this seems to shut off email notification, definitely not something you or I intended!

    1. I was wondering, just to confirm, did you test this with DB10 Pro or BR Free 10.2 ?


    2. Is it that important that it opens a progress window and then closes it at end of job ?

    ...The main question is by removing --graph and getting a console window, does it at least prevent you from getting timeout error in windows task scheduler ? (No user intervention, since No gui window thst would require a user action)

    ..... If yes, then I would think the only important issue left would be gettting email notification on job failure in this mode (without the --graph switch). ... I guess for that you will need to directly contact paragon tech support for email issue or use a 3rd party task scheduler with email feature, etc.

    Updated, FYI, I tested without --graph switch and I only get 1 console window, you must be getting 2 console windows due to some issue with running under Win 7.


    BTW, Win 7 Questions

    A. I am curious, regarding the new Task Scheduler in Win 7, does the History option display all output that a job/task writes as output to the command console window and if yes, can the History display be filtered easily to find only what output is related to a specific task/job ?

    B. Does the New Task Scheduler in Win 7 have an email option that you can set when a Task fails (non-zero exit code) ?
     
    Last edited: Aug 10, 2010
  14. DrumMemory

    DrumMemory Registered Member

    Joined:
    May 28, 2010
    Posts:
    26
    JosephB,

    1. These phenomena occur in both versions. But since only DB10 provides email support, that's where I have been doing my testing.
    2. Your suspicion that the non-graphical window would close automatically and not lead to a time out is correct. Task scheduler now returns the correct error. (DB10 Pro) So we have a quandary -- use the email notification and by not receiving an email, know that an error occurred; not use email notification, so not have an obvious sign of error, but learn the real error code. I see two solutions -- a third party solution such as you use or a two step approach with DB10 -- use email to have good notification of errors, then turn off --graph or run interactively to find out what the error is. This only addresses what we have been calling problem case 3.
    3. (A) I'm not much of an expert on Windows history. From what I see with "history enabled" is lots of detailed steps in the execution of the task, as when the script engine appears to spawn subtasks, but no output directly from DB10. However, this is a pretty incomplete picture -- DB10 scripts try to write if there is a run-time error caught by DB10, but I don't have history on one of those events (of which I think I have seen only one, which was not reproducible). So I really don't have data to see.
    4. (B) The answer is "yes". One can schedule a sequence of actions as a single task. The choices for actions are to start a program (what DB10 does), to display a message or to send an email. That last choice seems to be what we might want to do following the execution of script.exe. The task scheduler provides a box in which to specify the text of the message. I do not know enough Windoze command language to know how we could insert the error code returned by the previous action into the text of the message. If someone more knowledgeable can help on that, BR Free users on Windows 7 could have the benefit of at least partial email notification.
     
  15. JosephB

    JosephB Registered Member

    Joined:
    Jan 3, 2008
    Posts:
    310
    DrumMemory,

    Thanks for info on win7 task scheduler. I sent you a pm.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.