XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Custom script execution after backup job

    Scheduled Pinned Locked Moved Xen Orchestra
    5 Posts 2 Posters 695 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AnonabharA Offline
      Anonabhar
      last edited by

      Hi Everyone,

      I was wondering if there was a way to execute a custom script (bash, etc) after a backup job has been completed. Ideally I would love to be able to execute a script after each VM is completed, but would be happy with just calling a script after all VM's have been completed.

      What I am trying to achieve is this: We have multiple DC's that we have our VM running in. There is a 'prime' DC that handles 99% of our traffic and a standby DC that mirrors the configuration. Each night I perform delta backups of the VM's in the prime DC and over the weekend I perform CR backups to the backup.

      In times of failure in the prime DC, I would have to change BGP routing to point the prime's IP address to the backup DC and then incrementally start up each VM. We are looking at ways to shorten the time required to start each of the VM's in the backup and have a hot-standby VM ready / What we are investigating is the possibility of doing delta and CR backups at the same time between the DC's and leaving a 'copy' of the CR backup running ready to slot in place in times of failure.

      Obviously we would have to copy the CR backup to another VM and start this up, but this is where the automation would be nice. If there was a way to tell an external script that a VM has completed its backup task, we can let the script shutdown the current CR-Copy, destroy it, copy the CR-backup to the new CR-Copy and then start it. So, in times of failure, I would only have to worry about the physical routing to change on the networks and not have a delay of starting the VM's

      Anyone have any ideas on how this can be done easily?

      Kind Regards,
      Peg

      1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        Webhooks are what you seek 🙂

        AnonabharA 1 Reply Last reply Reply Quote 0
        • AnonabharA Offline
          Anonabhar @olivierlambert
          last edited by

          @olivierlambert Thanks!! I thought there might be something that I could tie into. Would you mind pointing me in the direction of any Doc's for the webhooks and I will start digging though them and see what I can put together 😎

          1 Reply Last reply Reply Quote 0
          • olivierlambertO Offline
            olivierlambert Vates 🪐 Co-Founder CEO
            last edited by

            It will send content into a target URL. So you need a web service listening on destination of this URL to get the content.

            AnonabharA 1 Reply Last reply Reply Quote 0
            • AnonabharA Offline
              Anonabhar @olivierlambert
              last edited by

              @olivierlambert Ah.. I'm being thick.. I didnt have the plugin loaded so I was wracking my brains to try and find out where the hook would have been called.. Thanks for you help, and back to coding! 8-)

              1 Reply Last reply Reply Quote 0
              • First post
                Last post