Skip to main content

Machine name as parameter for post backup script

Thread needs solution

Hello there,

is it possible to pass the machine name or the name of the backup file as argument/parameter to a post backup script?

I did not find any valid solution for this.

Regards

Frank

 

0 Users found this helpful

Hello Frank!

I don't think it's possible to do this directly. You can query plan-id, plan-name etc. by executing acrocmd commands. The FQDN computer name you could just query directly through the shell you are using.

What are you planning to do in post backup?

-- Peter

Hello Peter,

i have to post-process the backup files. For instance, we want up to 3 copies of the backup files on another location. Acronis itself does not properly do such things (does not delete the 4th, 5th,... copy as i specified in the job and such stuff) .

Therefore i have to find a way to pass the machine name to a script, for instance.

In the Acronis UI, i can name the backup file to the machine name using the parameter [machine name], but this is not working for scripts.

Is there a known way to do such things?

Regards

Frank

Hello Frank!

You can do this with acronis, you'll just have to configure a cleanup task as well as replication for the 2nd and 3rd location. There is a retention rule for keeping just 3 backups.

The machine name is just the FQDN name of the device you are backing up. For powershell here are some solutions for querying it.

-- Peter

Hello Peter,

seems not to be so easy ;-)

The retention rules don't work (for me), as they don't delete any of the older backups.

I have to backup several virtual machines on a hyper-v host, on which is Acronis installed. So the machine names are different from the host name and i have to process them separately.

Regards

Frank

Hello Frank!

I assume you are making a backup on the hypervisor level, and not by having an agent inside all the vms. I can't think of an acrocmd based approach, my only idea is to address your question to the DB.

You could find the latest archives the agent for this host made/added to. Unfortunately I don't have similar setup, so I don't know for sure how this scenario appears in the db and therefore can't show a meaningful SQL as a starting point.

The acronis_vault_manager.dbo.Archives table does keep a column for archive names (what I understand you are after) and the acronis_backup_manager.dbo.resources could help locate the ids for the host and vms. You still have to account for split backups and the appropriate extensions, as they are not included in the name.

I also have no idea when records would enter the db. I.e. If they are available at the time post-commands are running.

I'm also assuming neither the source nor target locations are deduplicated, as you can't just copy the archives in and out without the help of acronis. 

As for your retention rules not working, I can't really comment without having a look at both the backup and cleanup plans. You can export both to a json file by selecting and exporting the plans.

-- Peter