Salta al contenuto principale

Run Batch before Backup Job

Thread needs solution

Hello,

I want to run a batch file before the Backup Job starts.

The batch file is located in the following path:
C:\BackupScript\HDDLetter.bat

The batch file has the following contents:
Diskpart.exe /s "C:\BackupScript\HDDLetterScript.txt"

In HDDLetterScript.txt is the following:
Select volume 5
Assign letter=x

If I run the batch file normally with a double-click, everything works.
My external hard drive gets the drive letter X

I always get an error when testing with Acronis.

In Acronis I have the following path:
C:\BackupScript\HDDLetter.bat
Also tried: C:/BackupScript/HDDLetter.bat

As a working directory I have tried the following:
C:\BackupScript
C:\BackupScript\
C:/BackupScript
C:/BackupScript/
and empty

Did I do something wrong?
How does it have to be done right?

Thanks

0 Users found this helpful
frestogaslorastaswastavewroviwroclolacorashibushurutraciwrubrishabenichikucrijorejenufrilomuwrigaslowrikejawrachosleratiswurelaseriprouobrunoviswosuthitribrepakotritopislivadrauibretisetewrapenuwrapi
Messaggi: 22
Commenti: 3800

Hi Daniel,

I've tried the same sequence on my test machine using build #3689 (latest released update) of Acronis Backup 12 and the batch file worked properly when set up in pre/post commands (the new volume got proper drive letter assigned). Please see screen shot attached illustrating the setup I've created. Please advise which exact error you get when trying to run the plan in your environment?

Thank you.

Allegato Dimensione
407297-137461.png 109.19 KB

Hey Vasily,

thanks a lot.
I got excaly the same config like you.

It is a german installation.
I hope you can read or translate it.
I think after the red line are the subsequent errors.

The exact error is:
Backup ist fehlgeschlagen
Fehler beim Erstellen der Datei.
Fehlercode 0x01330029+0x01350016+0x01350016+0x01330021+0x009A000D+0x009A000D+0x0040002E+0x0004000A

Details:
Fehler
Datum und Zeit
21. März 2017, 07:48:38
Modul
307
Nachricht

Zusätzliche Informationen:

------------------------
Fehlercode: 41
Modul: 307
Zeileninfo: 0xE6792A5EE190DDE7
Felder: {"$module":"agent_protection_addon_vsa64_3689"}
Nachricht: Ausführen des Befehls fehlgeschlagen.
------------------------
Fehlercode: 22
Modul: 309
Zeileninfo: 0x8D165E86FB819595
Felder: {"$module":"mms_vsa64_3689","CommandID":"6F33AD8F-B487-4B18-87A3-C5DBD7B77B95"}
Nachricht: TOL: Failed to execute the command. Checking sources and vault in backup plan
------------------------
Fehlercode: 22
Modul: 309
Zeileninfo: 0x8D165E86FB819595
Felder: {"$module":"gtob_ensure_backup_invariants_command_addon_vsa64_3689","CommandID":"6F33AD8F-B487-4B18-87A3-C5DBD7B77B95"}
Nachricht: TOL: Failed to execute the command. Checking sources and vault in backup plan
------------------------
Fehlercode: 33
Modul: 307
Zeileninfo: 0x5D2A9295CC9442E7
Felder: {"$module":"gtob_ensure_backup_invariants_command_addon_vsa64_3689"}
Nachricht: EnsureBackupInvariantsCommand: Failed to prepare the location for the backup archive.
------------------------
Fehlercode: 13
Modul: 154
Zeileninfo: 0x09A79F20828BCAB6
Felder: {"$module":"disk_bundle_vsa64_3689","IsReturnCode":"1"}
Nachricht: Das Depot ist nicht verfügbar.
------------------------
Fehlercode: 13
Modul: 154
Zeileninfo: 0x90BBCA5EAF5C5C69
Felder: {"$module":"disk_bundle_vsa64_3689"}
Nachricht: Das Depot ist nicht verfügbar.
------------------------
Fehlercode: 46
Modul: 64
Zeileninfo: 0x3F26773FAB7BDAC8
Felder: {"user":"","$module":"disk_bundle_vsa64_3689","path":"file:X:\\"}
Nachricht: Öffnen des Backup-Speicherorts fehlgeschlagen.
------------------------
Fehlercode: 10
Modul: 4
Zeileninfo: 0xF35F747B3B21F8E7
Felder: {"$module":"disk_bundle_vsa64_3689"}
Nachricht: Fehler beim Erstellen der Datei.

frestogaslorastaswastavewroviwroclolacorashibushurutraciwrubrishabenichikucrijorejenufrilomuwrigaslowrikejawrachosleratiswurelaseriprouobrunoviswosuthitribrepakotritopislivadrauibretisetewrapenuwrapi
Messaggi: 22
Commenti: 3800

Hi Daniel,

Thank you for the clarifications, I believe I see what the problem is: you're trying to mount the target backup location _before_ the backup via pre/post commands. The issue is that the backup location initialization and detection is performed by backup plan _before_ running the pre/post commands, so your X: drive simply doesn't get mounted via the batch file from pre/post commands at this stage and thus entire plan fails. This scenario is not something that would work through pre/post commands in the current version of Acronis Backup. You should schedule the drive mounting (pre-command) via default Windows scheduler which will run the batch file before the backup plan should run, while the unmounting can be done via post-backup command from backup options.

Thank you.

Hey,

okay thx.
Then I'll run the batch with Windows scheduler.

Greetings from Germany
Daniel