Command line interface (CLI)¶
Overview¶
SmartUnifierCli is a command-line tool designed for managing backups and restores in the Smart Unifier system.
It is intended for use in automation scripts (.bat and .sh), making it suitable for programmatic execution.
Usage¶
Command Syntax¶
SmartUnifierCli <command> [options]
Available Commands¶
1. Backup System¶
Fetches backup data and saves it locally.
SmartUnifierCli backup -u <username> -p <password> [-f <filename>]
Options:
-u: Username for authentication.-p: Password for authentication.-f <filename>: Optional. Specifies the filename to save the backup.
Example:
SmartUnifierCli backup -u admin -p secret -f my_backup.tar.gz
2. Restore System¶
Uploads a backup file for restoration.
SmartUnifierCli restore <file-path> -u <username> -p <password>
Example:
SmartUnifierCli restore /path/to/backup.tar.gz -u admin -p secret
The restore process outputs streamed progress information to the console.
Exit Codes¶
SmartUnifierCli returns an exit code of 0 when the command executes successfully.
Any non-zero exit code indicates an error.
This behavior allows integration into scripts where error handling is required.
Shell Script Example (.sh)¶
SmartUnifierCli backup -u admin -p secret -f my_backup.tar.gz
if [ $? -ne 0 ]; then
echo "Backup failed"
exit 1
fi
Windows Batch Script Example (.bat)¶
@echo off
SmartUnifierCli backup -u admin -p secret -f my_backup.tar.gz
if %ERRORLEVEL% NEQ 0 (
echo Backup failed
exit /b 1
)