Aug 15, 2014
When Bvckup 2 is running, it is possible to control and query the app from command line. For example, it's possible to start a backup job, to check its status or to query whether the app has a valid license.
The app can be controlled from the command line while it's running in both desktop or service mode.
It is possible to lock down the access so that only privileged accounts could access the app through this interface. It is also possible to disable this feature completely.
This feature was introduced in Release 70 and several new commands were later added in R74.20 and R76.
From the command line run:
bvckup2.exe --command <command> [<arguments>]
If you are using a custom configuration folder, then you will need to pass its location using the -c argument:
bvckup2.exe --command -c <your-config-path> <command> ...
Completion status of a command is returned as a process exit code, which Windows puts in the %errorlevel% variable. For example, if the following script is saved as command.bat:
bvckup2.exe --command %1 %2
and then executed:
command.bat enable "test backup"
it will print:
meaning "OK" if a job called "test backup" was in fact enabled. Otherwise it will print a non-zero number, indicating a failure.
Negative return codes come from the "bvckup2.exe --command" process:
-10 through -60 => command syntax error
-70 => command parameter is too long
-80 through -100 => can't find the process
-110 through -130 => can't connect to the process
-140 => command aborted
-150 => timeout waiting for reply (30 sec)
Non-negative return codes come from the main bvckup2.exe process, meaning that it got to see the command and responded to it:
0 => OK
1 => Not found
2 => Bad state
3 => Not idle
4 => Bad parameter
5 => Not found
100 through 106 => backup job status (see below)
200 and 201 => licensing status (see below)
Commands - Job control
Backup jobs can be controlled using "start", "stop", "enable", "disable", "pause" and "resume" commands that do what you'd expect them to do.
Additionally, as of R77.3 it's possible to "delete" and "unload" backup jobs, whereby "delete" is equivalent to deleting a job via the UI and "unload" is a non-destructive variation of "delete" that merely removes the job from the app's run-time list for the duration of current run.
Each command also takes a job description as parameter:
bvckup2.exe --command start "Daily to NAS"
Job description is the actual "Description" string from the backup's configuration. Alternatively, a job can be specified with its numerical ID:
bvckup2.exe --command enable job:2
HOWEVER, note that if you re-sort backup tiles in the UI, you may end up with the 1st job sitting in the middle of the list. In other words - use with care.
Finally, as of R77.3 a job can be identified by the name of its folder in Bvckup2\engine directory, e.g.
bvckup2.exe --command enable etc:backup-0001
As of R74.20 it is possible to use * as a job ID:
bvckup2.exe --command pause *
In this case specified command is applied to all backups in matching state, e.g. "start" will kick off all idle jobs, "pause" will pause all jobs that are running, etc.
Commands - Job status
It is possible to query the exact state of a backup job:
bvckup2.exe --command status <job>
which is then returned through exit code as follows:
100 - disabled
101 - waiting for device
102 - idle
103 - queued to be run
104 - running
105 - cancelling
106 - paused
Commands - Loading a new job
As of R77.3 it's possible to tell the app to pick up a new backup job from Bvckup2\engine folder. It's done with
bvckup2.exe --command load etc:<job-folder>
This will effectively load the job and schedule it just as if it was present in the config folder when the app was launched.
Commands - General status
As of R74.20, it's possible to check if there are any running jobs or if the app is presently idle:
bvckup2.exe --command is-idle
will return 0 if the app is idle and non-zero if there are any running backups.
Commands - Graceful shutdown
As of R76, it is possible to initiate graceful shutdown of the app with:
bvckup2.exe --command terminate
If the app is running in service mode, this command will bring down the service, which will in turn bring down the UI if it's open.
Commands - License status
As of R76, it's possible to check app's licensing status with:
bvckup2.exe --command is-activated
which will return 0 if the app has a valid, non-expired license (including a trial one), 200 if it's in the process of being activated and 201 if the app is running in "unlicensed" mode.
Commands - License activation
As of R76, the following command can be used to instruct the app to pull down a license using specified activation code:
bvckup2.exe --command activate <code>
It will return 4 ("bad parameter") if <code> is not specified, 2 ("bad state") if the app is NOT in unlicensed state and 0 otherwise, meaning that it started the activation process.
Aug 15, 2014
The status command isn't really working for me (returncode wise).
bvckup2.exe --command start "Test1"
... This profile copies 10GB and is running now (can see it via the animated tray icon) ...
bvckup2.exe --command status "Test1"
... Profile was still running ...
0? It should return 104...
Oct 10, 2015
Will the " --command start * " work if the configuration location as specified in the redirect.ini is NOT the default of %LocalAppData% ?
I have tried several times to run this from the command line but it has not worked.
Note: the redirect.ini IS Also in the ..\User\AppData\Local\Bvckup2\ directory.
I have tried the following without success:
C:\BIN\Bvckup2\bvckup2.exe -d --command start *
C:\BIN\Bvckup2\bvckup2.exe -c C:\Bin\BvckUp2\Cfg --command start *
C:\BIN\Bvckup2\bvckup2.exe --command start * -c C:\Bin\BvckUp2\Cfg
and even your script of:
bvckup2.exe --command start *
timeout /t 1 /nobreak >nul
bvckup2.exe --command is-idle
if %errorlevel% neq 0 goto again
In addition to this problem, I found that if you have "run with full admin rights" checked in the preferences you can not automate this at all with
task scheduler or any other call command because it brings up the UAC permissions dialog.