Salta al contenuto principale

PRE/POST commands

Thread needs solution

We are using RDX cartridges for our backups. It is configured as a removable disk.

Now we want like to reject the cartridge after a SUCCESSFUL backup. We do that with a small batch file which one works fine.

The problem is that there is no possibility to check if the backup was successful and then only the disk should be ejected.

Any idea how to get the worked?

0 Users found this helpful

Hi,

you could build a batch file and parsing the activity log from acronis using the acrocmd.exe:

http://www.acronis.com/en-us/support/documentation/AcronisBackup_12_Com…

An example would be:
C:\Program Files\Acronis\CommandLineTool>acrocmd.exe list tasks --filter_last_result=succeeded --log_format=structured --log=C:\temp\list_tasks_filtered.txt

You will get a XML like structured text file which should be easy to parse.

It is possible to enable "Log to Windows Event Log" in backup plans and use Microsofts LogParser ( https://www.microsoft.com/en-us/download/details.aspx?id=24659 ) to get last backup state.

C:\Program Files (x86)\Log Parser 2.2>LogParser.exe -O:CSV "SELECT TimeGenerated, SourceName, Message INTO c:\temp\report.txt FROM Application WHERE SourceName LIKE 'Acronis%' ORDER BY TimeGenerated DESC"

Sample output would be:

TimeGenerated,SourceName,Message
2016-08-11 14:00:04,Acronis Backup and Recovery,Event 0x900001: Error code: 12 | Task 'Incremental backup' completed successfully. | trace level: information 
2016-08-11 13:04:59,Acronis Backup and Recovery,Event 0x900001: Error code: 29 | Task 'Incremental backup' was canceled. | trace level: information 

Allegato Dimensione
382543-132373.png 10.02 KB

Dear Raphale, many thanks for your fast and precice reply. I will try it and post my results here.

TC

Stefan

Hello Stefan,

Alternatively, you should be able to use a simpe post command because post commands normally don't run if the backup failed.

Post-data capture commands always run because these are used to start/stop with databases/