Knowledge Base & Discussion Forum

Pre/Post Command Exit Codes / Error Detection

Discuss any other issues related AhsayOBM

Moderator: Support Team

Pre/Post Command Exit Codes / Error Detection

Postby gstrike » Thu Feb 13, 2014 5:25 am

Hey Guys,

I couldn't find this information online anywhere so I wanted to make sure I posted it for all to see. I'm new here, so I apologize if this is common knowledge.

I have some Pre/Post commands defined for some of my backup jobs. If one of these fails I want to make sure that it is reflected as an error in the backup log.

I tried exiting my scripts using exit codes, as is common practice, to have AhSay detect the error. Unfortunately, it doesn't seem that AhSay monitors exit codes. It didn't matter what I set the exit code to, it was always detected by AhSay as successful.

However, through my testing AhSay DOES monitor STDERR, at least on Windows where I was testing this. After a Pre/Post job is run, it looks like AhSay will check STDERR to see if there's anything in there. If there is, an error has occurred. If it's empty, it was successful. So, exit codes... no dice!

Here are some ways to redirect to STDERR:

DOS/BATCH/CMD:
Code: Select all
ECHO There was an error! 1>&2


PowerShell:
Code: Select all
Write-Error "There was an error!"


Bash:
Code: Select all
echo 'There was an error!' 1>&2
gstrike
 
Posts: 1
Joined: Thu Feb 13, 2014 5:04 am

Re: Pre/Post Command Exit Codes / Error Detection

Postby tethis-it » Wed Jul 12, 2017 1:19 am

Hi there,

I was just trying the same and it seems that output to stderr is noticed, but it doesn't cause the backup job to stop.
It just shows a warning in the backup log.

Well, I'll open a ticket for this...
User avatar
tethis-it
 
Posts: 16
Joined: Sun Sep 07, 2008 1:41 am
Location: Vienna, Austria

Re: Pre/Post Command Exit Codes / Error Detection

Postby Rylos » Wed Apr 18, 2018 11:42 pm

Did either of you get anywhere with this?

I am using VBScript to do some prebackup stuff and would like to have some way to write an error or issue.
Rylos
 
Posts: 36
Joined: Tue Dec 30, 2014 8:34 pm

Re: Pre/Post Command Exit Codes / Error Detection

Postby Richard Au » Fri Apr 20, 2018 3:13 pm

Rylos wrote:Did either of you get anywhere with this?

I am using VBScript to do some prebackup stuff and would like to have some way to write an error or issue.


To help us looking into this issue, could you please contact our support to verify on this? Please submit your case through our ticket system at https://www.ahsay.com/partners/en/home/ ... rt_tickets
Richard Au
Ahsay Forum Support Team
User avatar
Richard Au
 
Posts: 241
Joined: Wed Aug 31, 2016 10:43 am


Return to Others

Who is online

Users browsing this forum: No registered users and 1 guest

Looking for Rbackup Alternative | Vembu Alternative | Novastor Alternative | Asigra Alternative | BackupAgent Alternative? Try our product.


A wholly owned subsidiary of Ahsay Backup Software Development Company Limited  [HKEx Stock Code: 8290]