Skip to main content
Solved

Executing shell script inside a guest OS after backup completion


Forum|alt.badge.img+1
  • 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?

Best answer by MicoolPaul

Abela wrote:
dips wrote:

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

View original
Did this topic help you find an answer to your question?

5 comments

Chris.Childerhose
Forum|alt.badge.img+21
  • Veeam Legend, Veeam Vanguard
  • 8512 comments
  • September 1, 2021

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

 


dips
Forum|alt.badge.img+7
  • Veeam Legend
  • 808 comments
  • September 1, 2021

Hi @Abela 

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


Forum|alt.badge.img+1
  • Author
  • Not a newbie anymore
  • 6 comments
  • September 2, 2021
Chris.Childerhose wrote:

@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.


Forum|alt.badge.img+1
  • Author
  • Not a newbie anymore
  • 6 comments
  • September 2, 2021
dips wrote:

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?


MicoolPaul
Forum|alt.badge.img+23
  • 2362 comments
  • Answer
  • September 2, 2021
Abela wrote:
dips wrote:

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