Skip to main content

UpdatePreCommand

July 21, 2025

This API can be used to update a pre-backup command of a backup set.

The settings can be found on the AhsayCBS web console at:

  • Backup / Restore > Users, Groups & Policies > Backup User > %User Name% Backup Set > %Backup Set Name% > Command Line Tool

URL

https://CBS.EXAMPLE.COM/obs/api/json/UpdatePreCommand.do

Available Since Version: 9.1

Parameters

Key Type Description
SysUser String Username of an AhsayCBS System User with Admin or API role.
SysPwd String Password matching SysUser.
LoginName String Username of the backup user.
BackupSetID String ID of the backup set. Obtainable in ListBackupSets API.
ID Long ID of the command. Obtainable in GetBackupSets API.
Name String Name of the command.
WorkingDir String Directory where the command takes place.
Command String Actual command.
Username String If username and password are empty, add the address without credential.
Password String If username and password are empty, add the address without credential.
Return Values
Key Type Description
Status String "OK" or "Error"
Message String Error message, it only appears if status displays "Error".
ExptType String The type of exception, will only be displayed if the status is "Error".
Examples

Example 1: Update name

INPUT

{
	"SysUser":"system",
	"SysPwd":"system1",
	"LoginName":"obm",
	"BackupSetID":"1687755057644",
	"ID":"1687755342349",
	"Name":"newname"
}

OUTPUT

{
	"Status":"OK"
}

Example 2: Update command content

INPUT

{
	"SysUser":"system",
	"SysPwd":"system1",
	"LoginName":"obm",
	"BackupSetID":"1687755057644",
	"ID":"1687755342349",
	"Command":"newcommand"
}

OUTPUT

{
	"Status":"OK"
}

Example 3: Update working directory

INPUT

{
	"SysUser":"system",
	"SysPwd":"system1",
	"LoginName":"obm",
	"BackupSetID":"1687755057644",
	"ID":"1687755342349",
	"WorkingDir":"newworkingdir"
}

OUTPUT

{
	"Status":"OK"
}