Skip to main content

How can we help you?

Druva Documentation

Sample pre-backup script for System State Backup and MySQL Dump

 

This article applies to:

  • Phoenix Cloud
  • System State backup
  • MySQL Dump
  • File Server

Overview

Phoenix allows administrators to configure File server agents to execute custom pre-backup scripts and post-backup scripts. 
For more details, refer Pre backup and post backup scripts for File server.

The objective of this topic is to back up the following using pre-backup scripts:

  • Domain Controller
  • MySQL DB

Procedure

Create the pre-backup scripts as per the following conventions:

  • Linux File server: pre_script.sh and post_script.sh
  • Windows File server: pre_script.bat and post_script.bat

Commands

Command for system state backup

wbadmin start systemstatebackup -backupTarget:\\servername\share -quiet 

Command for MySQL Dump

 For all databases:  mysqldump -u root -p --all-databases -h hostname > /var/log/databases/AllDB.sql

For a single database named TestDB: mysqldump -u root -p TestDB > tut_backup.sql