The support forum

Pre and post commands with veracrypt

Psychicactus :

Jan 30, 2020

Hi, great software! The only thing is I can't understand how to use this feature. I looked over the instructions you have here https://bvckup2.com/support/forum/topic/98 and a few other topics that are related but I don't get how to apply it to my situation. I am not a programmer so a bunch of it is alien to me.

I want the software to mount a veracrypt-encrypted device, back-up to it, and dismount it. I figured out how to create a functioning command line script that will mount the device successfully when run manually from the command line in windows. However, I am not sure how to actually put this into bvckup2. I also implemented that override which stops bvckup2 from waiting for the destination device.
This is what I put into the pre-command box:

cmd "C:\Program Files\VeraCrypt\VeraCrypt.exe" /l z /q /v \Device\Harddisk2\Partition1

and nothing happens when I run the job. It just says:

2020.01.30 01:51:58.241 (UTC-8) 0 0 Backup needs to run, but destination device is not present

Alex Pankratov :

Jan 30, 2020



This message is logged only when the backup is run on schedule, but the program itself. The scheduler sees that a backup is due, it checks if both source and destination devices are present and runs the backup ONLY if they are. If either or both aren't present, it logs this messages and skips the backup altogether, so your pre-backup script doesn't get a chance to do its thing.

To force scheduler to NOT check devices, you will need to put this override in place - https://bvckup2.com/support/forum/topic/1139/6288

All that said, what do you see in the log when you run the backup by hand, via the Go button?

Psychicactus :

Jan 30, 2020

Not sure what this sentence means: "This message is logged only when the backup is run on schedule, but the program itself."

When I click Go, it opens up a cmd window with no command in it. The log says the following:

2020.01.30 08:17:59.806 (UTC-8) 2 0 Running the backup ...
2020.01.30 08:17:59.806 (UTC-8) 2 1     Preparing ...
2020.01.30 08:17:59.807 (UTC-8) 3 2         Run number: 1
2020.01.30 08:17:59.807 (UTC-8) 3 3             Version: 80.7
2020.01.30 08:17:59.807 (UTC-8) 3 3             Source: C:\Users\User1\Documents\tech\Test 4\
2020.01.30 08:17:59.807 (UTC-8) 3 3             Destination: Z:\test 4\
2020.01.30 08:17:59.807 (UTC-8) 3 3             Copying: contents, timestamps (modified, created, accessed), attributes
2020.01.30 08:17:59.807 (UTC-8) 2 2         Running external pre-backup command ...
2020.01.30 08:17:59.816 (UTC-8) 3 3             Command: cmd "C:\Program Files\VeraCrypt\VeraCrypt.exe" /l z /q /v \Device\Harddisk2\Partition1
2020.01.30 08:17:59.816 (UTC-8) 3 4                 Spawn as: process
2020.01.30 08:17:59.816 (UTC-8) 3 4                 Timeout: 1 hour
2020.01.30 08:17:59.816 (UTC-8) 3 4                 Exit code: any
2020.01.30 08:18:07.863 (UTC-8) 3 3             Completed
2020.01.30 08:18:07.864 (UTC-8) 3 4                 Exit code: 3221225786
2020.01.30 08:18:07.864 (UTC-8) 2 2         Verifying configuration ...
2020.01.30 08:18:07.865 (UTC-8) 2 2         Checking source...
2020.01.30 08:18:07.865 (UTC-8) 3 3             Normalized path: \\?\C:\Users\User1\Documents\tech\Test 4\
2020.01.30 08:18:07.924 (UTC-8) 2 2         Checking destination...
2020.01.30 08:18:07.924 (UTC-8) 3 3             Normalized path: \\?\Z:\test 4\
2020.01.30 08:18:08.022 (UTC-8) 0 3             Error: destination device is missing
2020.01.30 08:18:08.027 (UTC-8) 2 1     Completed in 8.22 sec with 1 error

Psychicactus :

Jan 30, 2020

Also, I already put that override in place by following those instructions.

Psychicactus :

Jan 30, 2020

Not sure if it makes a difference, but the software is an expired trial. My computer with the licensed software is at the repair shop, so I have to use my laptop to test this out because I'm on a deadline.

Alex Pankratov :

Jan 30, 2020

Ah, sorry about that (sentence). I meant that this -

Backup needs to run, but destination device is not present


is logged only when the backup is run on schedule. It is not logged when a backup is kicked off with Go.

In any case, do you see Z: getting mounted when you run the backup with Go?

If you do, then it's a matter of timing. System notification doesn't get delivered to bvckup (or it doesn't process it) quickly enough, so it remains under the impression that Z: is still not there when the pre-backup command completes.

What you can do here is put your mounting incantation into a batch file and add a little delay after it before exiting. I looked it up just now and apparently there's no "sleep" on Windows, so you have to do something like this in your .bat -

    "C:\Program Files\VeraCrypt\VeraCrypt.exe" /l z /q /v ...
    ping -n 1 127.0.0.1 >nul

Then just put "X:\Path\To\Your\batch-file.bat" as a pre-backup command and it should do it.

Psychicactus :

Jan 30, 2020

Ok. No, when I run the back-up with go it does the same thing.  Just says waiting for the destination device.

Psychicactus :

Jan 30, 2020

By the way, I tried implementing what you said here: https://bvckup2.com/support/forum/topic/726
but there is no entry for "conf.src_force_present 1" in the settings.ini file.

Psychicactus :

Jan 31, 2020

Ok, so far I was able to make it work, but am not sure completely why... :D I will report back after further testing.

Alex Pankratov :

Jan 31, 2020

but there is no entry for "conf.src_force_present 1" in the settings.ini file.


It's been renamed into "conf.wait_for_src" and it needs to be set to 0. I edited the post you linked to to clarify.

Psychicactus :

Feb 01, 2020

Ok, cool.

Psychicactus :

Feb 12, 2020

Alright. The error was on my end.
I got it working perfectly on a test by implementing the override. It's fast and smooth... unbelievable. Thanks!

New topic

Create
Made by IO Bureau in Switzerland
Support

Updates
Blog / RSS
Follow Twitter
Reddit
Miscellanea Press kit
Testimonials
Company Imprint

Legal Terms
Privacy