Skip to main content



How can we help you?


Druva Documentation

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

Heads up!

We've transitioned to a new documentation portal to serve you better. Access the latest content by clicking here.


This article applies to:

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


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


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

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


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