The support forum

Beta Release 26

Alex Pankratov :

Aug 11, 2013

.

Major - Pre/Post-backup commands


It is now possible to execute arbitrary commands immediately before and immediately after a backup run. These can be configured in the More Options section of a backup config - http://bvckup2.com/wip/ext-commands-2.png

-- Command configuration --

Both commands have several attributes that control app's behavior (and that are currently configurable only manually, by editing the .ini).

1. Timeout - this controls how long bvckup waits for the command to complete. The default is 1 hour.

2. Critical - when set, it tells the app to abort the backup if the command times out or if it exits with a return code that is different from the one specified. This applies only to the pre-backup command and it is Off by default.

3. ReturnCode - the expected return value of a critical command

4. ShowCommand - this controls is the command will be spawned with its window shown, hidden, minimized, etc. All available values are listed here - http://msdn.microsoft.com/en-us/library/windows/desktop/ms633548%28v=vs.85%29.aspx, with the default being SW_SHOWNORMAL

*** As of Release 73 the following option is also supported -

5. Type - this controls if the command is launched by creating a process or via Windows shell. The default is "auto", meaning that the app looks at the command and if it specifies an existing file that ends with ".bat", then it uses the shell method. Otherwise it goes with the process option. Numerically, 1 = process, 2 = shell, 3 = auto.

-- Backup status --

In order to pass the specifics of a running backup to the command, the app sets up several environment variables.

BVCKUP_src - the source location
BVCKUP_dst - the destination
BVCKUP_description - the description
BVCKUP_run - the run number of the backup
BVCKUP_simulated - set to “yes” is if it’s a simulated run, “no” - otherwise

BVCKUP_state - the state of the backup and it is set to "Initializing" for pre-backup command, and to one of "Cancelled", "Completed", "Failed" for the post-backup command. The "failed" backup run is the one that did not manage to get to the actual backup phase and failed during the preparation (scanning/planning/etc) phase.

Additionally, for the post-backup command the following variables are also set -

BVCKUP_errors - the number of errors encountered by the backup
BVCKUP_files_created - self-explanatory
BVCKUP_files_updated - self-explanatory
BVCKUP_files_deleted - self-explanatory
BVCKUP_files_moved - self-explanatory
BVCKUP_bytes_read - how much data was read from the disk
BVCKUP_bytes_written - how much was written out

BVCKUP_time_started - start time (see below)
BVCKUP_time_finished - finish time
BVCKUP_time_taken - elapsed time in human readable format, e.g “4 hours 16 minutes” or “13 seconds”

_written will normally be less than _read if there are delta updates involved.

Start/finish time is in in “yyyy-mm-dd hh:mm:ss.mmm” format, e.g. "2014-07-19 11:22:33.444"

*** As of Release 71 the app sets up various additional variables to the total of about 50-60 that capture some OS details (for example, uptime), the app (version, license, etc) and the backup configuration.

*** As of Release 74.21 the set has been further extended to cover pre/post backup commands and details of their execution.

A good way to get a feel of how this all works is to set both commands to "cmd /k set". This will simply open a command line window and run "set" command that dumps the environment variables.

You should see something like this - http://bvckup2.com/wip/ext-cmd-pre.png and http://bvckup2.com/wip/ext-cmd-post.png

Type "exit" to close the window and let the backup proceed.

Assorted changes


1. Added timeout for VSS snapshot taking, defaulting to 4 minutes

2. Removed dependency on GetRegValue() function that accidentally slipped into BR25. This function doesn't exist on XP, so quite naturally BR25 had trouble starting on that fine operating system

3. Expanded the list of various temporary locations that are excluded by default from the backups. In particular, added locations of IE, Firefox and Chrome caches.

pgfitzgerald :

Aug 11, 2013

Yay, Pre/Post Scripts!

Well, it took some fiddling around with things, but I managed to get my pre/post scripts working. My scripts are written in PowerShell, which contributed to some of the issues. Here are some of the results of my testing:

1) I couldn't get them to run at all when in service mode. I'm unsure of whether they were actually being executed. Seems to work ok in non-admin mode. Once my initial backup runs I'll try again in admin mode, but I don't expect any issues.

2) Because the environment is clean and really only includes the ComSpec variable, PowerShell wouldn't execute at all and neither would VMware's vmrun command. I had to wrap my PowerShell script in a batch file and manually set the SystemDrive and SystemRoot environment variables.

3) At some point I tried executing something like "PowerShell &D:\Path\Script.ps1" and the Bvckup log panel interpreted the & like one might do to denote a shortcut key as in the &File menu. Probably no big deal, and might just be a display issue, but I figured I'd point it out just in case.

4) At some point I tried executing the script from a directory that contained a space in its name. I tried with and without quotes. I'm not sure if the errors I received were due to that or the missing environment variables, but the settings.ini included an entry that looked something like this:

conf.command_pre "cmd /c "d:\folder full of scripts\before-backup.bat""

Could be no big deal, but I thought that might be problematic for escaping quotes. Figured I'd bring it up just in case.

Have I mentioned I love the delta copy? Holy moly it's fast! I also really like how the progress bar shows the chunks of the files that are being copied/skipped.

pgfitzgerald :

Aug 11, 2013

Oh, I also have a question.

"What to backup" is set to "Everything with some exceptions" by default and also includes a sensible list of exclusions.

If "What to backup" is changed to "Start with an empty list", saved, and then set back to "Everything with some exceptions", those sensible exceptions don't come back.

Is that deliberate or perhaps a bug?

Alex Pankratov :

Aug 11, 2013

@pgfitzgerald - Very nice feedback, thanks a lot.

1) When running in service mode you can look at the log, there should be an entry like this one - https://bvckup2.com/wip/08082013

2) I can clone the environment of the bvckup's own process. I don't know what I haven't done it actually, so I now changed it to augment bvckup's env rather than to replace it.

3) Good catch, thanks, fixed (in other places too).

4) The .ini entry is OK. It adds enclosing pair of quotes if there's a space in the string.

Re: delta copy - You are a treasure trove of marketing quotes :-)

Alex Pankratov :

Aug 11, 2013

Is that deliberate or perhaps a bug?


No, not deliberate, just an oversight. Thanks, fixed.

pgfitzgerald :

Aug 11, 2013

@Alex Pankratov

BTW, uninstall seems to be broken on a clean install of beta 26.

I've recently begun receiving "Something went wrong" messages. It doesn't seem to be able to successfully submit the diagnostic file despite the fantastic little progress indicator you built into the button. :-)

Re: #1 I tried again in service mode. The log says the command ran, but it certainly didn't suspend my virtual machines before it proceeded to back them up. It appears as though the script did run, as it created the temporary file I use to ensure I only start up the VMs I initially suspend. So in my case, it would appear as though the LocalSystem account does not have the ability to programmatically interact with VMware Workstation. Bummer.

I'm not usually one to enjoy testing/qa, but I'm having a blast! Maybe it's because projects I've been involved with in the past have had little to no interaction. Feedback from you on feedback from the beta testers is very encouraging.

Alex Pankratov :

Aug 11, 2013

I'll check the uninstall, thanks.

Re: "something went wrong" - that crash info is first written into %LocalAppData%\Bvckup2\bvckup2.log and then it tries submitting the same info over HTTP to the server. Can you zip and email me a copy of the log? Or if you'd rather not send the whole log, just the parts that cover the crash points?

I got another report of the same kind, so I'd like to identify the cause and fix it asap.

Alex Pankratov :

Aug 11, 2013

... and I'm off for few hours, don't get discouraged :-)

Deipotent :

Jul 06, 2014

Is it possible to trigger another backup job to run as a post backup task ?

Alex Pankratov :

Jul 07, 2014

Nope, not at the moment. Let me see what I can do.

PaulK :

Jul 31, 2014

Any chance we could get environment variables for start and end times?

Alex Pankratov :

Jul 31, 2014

.
Would yyyy-mm-dd hh:mm:ss (tz) do? It would probably also make sense to add a var for the total run time, right?

PaulK :

Jul 31, 2014

Yes, and yes. That would be great.

Alex Pankratov :

Aug 18, 2014

So not to forget - as of R70 there are few more env variables.

BVCKUP_simulated
- set to “yes” is if it’s a simulated run and to “no” otherwise

BVCKUP_time_started
- start time in “yyyy-mm-dd hh:mm:ss.mmm” format, e.g. "2014-07-19 11:22:33.444"

BVCKUP_time_finished
- finish time in the same format

BVCKUP_time_taken
- elapsed time in human readable format, e.g “4 hours 16 minutes” or “13 seconds”

New topic

Create
Made by Pipemetrics in Switzerland
Support


Follow
Twitter
Dev blog
Miscellanea Press resources
Testimonials
On robocopy
Company
Imprint

Legal Terms
Privacy