I need custom backup job for my app:
App based on 3 VM on Vmware.
1) PSQL Database
2) S3 store
3) Kubernates in Docker with all microservices, mongo db, redis
I have scritp on host 3, which create propertly backup of App (create dump of files and databases in dir /backup/ in format APP_NAME_dir_date.)
For system consistency i need custom job on Veeam backup and replication server(connected to Vcentr server) for this rule.
1) prebackup task: propertly stop App with shell command on VM3
2) start custom backup script - create dir in backupdir /backup/ ,delete old backups from dir /backup
3) Propertly shutdonw host 3
4) create full backup of VMs 1,2,3
5) start VM 3 ,start app with script
Please advise how to get such a task correctly
-
- Lurker
- Posts: 2
- Liked: 1 time
- Joined: Jan 20, 2025 4:50 am
- Full Name: Shestakov Artur
- Contact:
-
- Veeam Software
- Posts: 2873
- Liked: 660 times
- Joined: Jun 28, 2016 12:12 pm
- Contact:
Re: Custom backup job for my App.
Hi Artur, welcome to the forums.
Steps 1-3 can be handled by an in-guest script, but you'll need to set a few special configurations to avoid the job erroring out once the machine shuts down. Executing scripts inside the guestOS is possible with pre-freeze and post-thaw scripts. You would write the bash script, place it in a location on the Veeam server, and during the job Veeam will copy the script to the guest and execute it as-is.
However, since our agent will be terminated when the machine shuts down, it won't be able to report back that the script was successful very likely, so for VM 3 you need to configure the following:
- Ignore script execution failures (step 4)
- Try application processing, but ignore failures (step 2)
This can be set per machine in the job, so only set this for VM 3. This is required because as noted above, once the machine shuts down, our guest agent won't be able to report back on the script execution, which normally would be an error and the job will abort.
As for starting the VM again, a post-job script to start it from the Hypervisor is appropriate, for example, you can use a quick script with powerCLI commands to connect to a vCenter and power on the machine. Starting the app is possible this way as well with PowerCLI, but it might be easier to have the in-guest script drop some placeholder file (e.g., /tmp/machinewasbackedup), and use some start-up script to look for this file, remove it if present and run your app start script.
Steps 1-3 can be handled by an in-guest script, but you'll need to set a few special configurations to avoid the job erroring out once the machine shuts down. Executing scripts inside the guestOS is possible with pre-freeze and post-thaw scripts. You would write the bash script, place it in a location on the Veeam server, and during the job Veeam will copy the script to the guest and execute it as-is.
However, since our agent will be terminated when the machine shuts down, it won't be able to report back that the script was successful very likely, so for VM 3 you need to configure the following:
- Ignore script execution failures (step 4)
- Try application processing, but ignore failures (step 2)
This can be set per machine in the job, so only set this for VM 3. This is required because as noted above, once the machine shuts down, our guest agent won't be able to report back on the script execution, which normally would be an error and the job will abort.
As for starting the VM again, a post-job script to start it from the Hypervisor is appropriate, for example, you can use a quick script with powerCLI commands to connect to a vCenter and power on the machine. Starting the app is possible this way as well with PowerCLI, but it might be easier to have the in-guest script drop some placeholder file (e.g., /tmp/machinewasbackedup), and use some start-up script to look for this file, remove it if present and run your app start script.
David Domask | Product Management: Principal Analyst
-
- Lurker
- Posts: 2
- Liked: 1 time
- Joined: Jan 20, 2025 4:50 am
- Full Name: Shestakov Artur
- Contact:
Re: Custom backup job for my App.
Thank you for your reply. I will test the circuit above and post!
Who is online
Users browsing this forum: Chris.E, Semrush [Bot] and 12 guests