Question

Executing shell script inside a guest OS after backup completion

  • 1 September 2021
  • 5 comments
  • 48 views

Userlevel 2
Badge
  • Not a newbie anymore
  • 6 comments

Hello there,

I want to execute a shell script inside a guest Linux VM automatically after a backup job is completed. I wonder how can i achieve this. What is the best way for me to do this?


5 comments

Userlevel 7
Badge +5

@Abela -- in your backup jobs there is Pre & Post script sections under the Advanced section of the Storage tab.

 

Userlevel 6
Badge +1

Hi @Abela 

You can run scripts post backup job. This should help: Script Settings - User Guide for VMware vSphere (veeam.com)

Userlevel 2
Badge

@Abela -- in your backup jobs there is Pre & Post script sections under the Advanced section of the Storage tab.

 

Thanks @Chris.Childerhose for the reply. I tried in this way but the scripts were executed locally on the backup server. However I intended to execute the script inside the guest OS of the VM being backed up.

Userlevel 2
Badge

Hi @Abela 

You can run scripts post backup job. This should help: Script Settings - User Guide for VMware vSphere (veeam.com)

Thank you for your response, @dips.... The documentation states that the script can only be run on the backup server, yet I have a shell script that is meant to run on a Linux OS system. which i am taking backup of it. is there any way to do this?

Userlevel 7
Badge +4

Hi @Abela 

You can run scripts post backup job. This should help: Script Settings - User Guide for VMware vSphere (veeam.com)

Thank you for your response, @dips.... The documentation states that the script can only be run on the backup server, yet I have a shell script that is meant to run on a Linux OS system. which i am taking backup of it. is there any way to do this?

Hi @Abela can the servers reach each other on the network? If so you could invoke whatever command you want from the backup server script.

 

Your alternative would be leveraging a post-thaw script, this would be uploaded to the VM, but I don’t know if this would be suitable depending on what the script you’re trying to run will do.

 

More information here: https://helpcenter.veeam.com/docs/backup/vsphere/pre_post_scripts.html?ver=110

Comment