abort.ifexitcode
The command abort.ifexitcode will abort the execution of the script if a previous call command returned the exit code != 0 when calling another application. The aborted script returns the obtained exit code.
This command is usually used when several call commands are to be called in succession.
Syntax:
Example
Function ScriptBeforeUpload
{
// $vdog::uploadjob->5002 holds the IP /hostname from the job configuration
$def::var1 = $vdog::uploadjob->5002
// Check IP/host name
ping Ip:$def::var1 loop:3 sleep:500
call BackupMyDevice.exe
{
arg /Addr:$def::var1
arg /DirDst:$vdog::specific->dirbackup
arg.nomarks /Account:$vdog::uploadjob->5003decode
arg.nomarks /Password:$vdog::uploadjob->5004decode
}
// abort, if BackupMyDevice.exe returned with an error (exitcode != 0)
abort.ifexitcode
// add an ASCII report to the backup data for compare reasons
call Backup2ASCII.exe
{
arg /Dir:$vdog::specific->dirbackup
}
// This script did all work for the job.
// There is no need to continue the job after this script with the upload logic
done
}
This script displays the standard process for carrying out the script event ScriptBeforeUpload:
- First, the network address (“IP address/computer name”) from the job configuration is passed to variable 1 ($def::var1).
- The pin command is used to check whether the network address is accessible.
- The call command is used to call up an application that can perform a backup for a specific device.Ideally, this application is provided as a tool by the device manufacturer. The following information will be provided in this script:
Information about authentification (user and password) are taken directly from the job configuration interface (usually for UNC).
- the IP address of the target device (via $def::var1)
- the target directory of the backup (so that the archive without other command copy can be transferred to the versiondog system)
- the authentification (for accessing the network)
- If the backup tool (
BackupMyDevice.exe
) returns with the error (exitcode != 0), the script will abort immediately. Otherwise the next script command (here the call command) will be executed. - The execution of an upload script is usually done alongside a UNC job. This is because the job configuration of this job contains usual upload parameters (network address and authentication). Done tells the system that the upload was executed using a script and that a UNC upload is no longer necessary.
Related Topics
Last update: September 15, 2023