In addition to running scheduled backup jobs and performing ad-hoc backups from the Veeam Agent for Microsoft Windows Tray Agent or Control Panel, you can create backups with the command line interface. For example, you can use commands for running a backup job in custom scripts to set up more detailed backup schedule than the daily schedule configured with the Control Panel.
You can run a backup job from the command line interface to create the following types of backups:
- Full or incremental backup (regular restore point in the backup chain)
- Standalone full backup
- Backup to another location
Before you create a backup from the command line interface, check the following prerequisites:
- The backup job must be configured.
- You cannot run a backup job from the command line interface if a backup task of any type is currently running. This includes a scheduled backup, standalone full backup or ad-hoc incremental backup.
- To create a standalone full backup or backup to another location, you must run the command line interface with administrative privileges.
To perform backup, use a command with the following syntax:
"C:\Program Files\Veeam\Endpoint Backup\Veeam.EndPoint.Manager.exe" /backup
To create a standalone full backup, use a command with the following syntax:
"C:\Program Files\Veeam\Endpoint Backup\Veeam.EndPoint.Manager.exe" /standalone
To create a standalone full backup to a different location than a location that is specified in the backup job settings, use a command with the following syntax:
"C:\Program Files\Veeam\Endpoint Backup\Veeam.EndPoint.Manager.exe" /standalone <location>
where <location> is a path to a folder in which the backup should be created.
You can specify a network shared folder as a target location for standalone full backup only if read and write permissions on this folder are granted to Everyone or to the LocalSystem account of the Veeam Agent computer. You cannot specify credentials to access the network shared folder in the command.
Monitoring Backup Job Status
When you start a backup job from the command line interface, it runs automatically in the background. You can view information about the backup job session or the created restore point in the Control Panel. To learn more, see Viewing Statistics in Control Panel.
You can also use the last exit code to verify if the backup job has completed successfully. To check the last exit code, use the %ERRORLEVEL% variable in cmd.exe.
Veeam Agent for Microsoft Windows can provide the following exit codes:
- 0 — backup successfully created
- -1 — backup job failed to start or completed with error
- 5 — backup job is currently running and cannot be started from the command line interface