Ask the Community
Groups
VMware Backup Pre- and Post-Commands - Connect IT Community | Kaseya
<main> <article class="userContent"> <h2 data-id="summary"><strong>SUMMARY</strong></h2> <p>VMware Backup Pre- and Post-Commands are commonly used to run custom scripts for freezing and thawing VMs during a backup</p> <h2 data-id="issue"><strong>ISSUE</strong></h2> <p></p> <h2 data-id="purpose">Purpose</h2> <p>This article outlines the VMware-supported method for running custom commands before and after vProtect backs up a virtual machine.</p> <h2 data-id="description">Description</h2> <p>Pre- and Post-commands are most often used to quiesce an application that does not have its own VSS provider (if Windows) to ensure a consistent state before backup. With VMware tools installed, VMware ESX 3.5 and later defines a specific location inside the VM where quiescing scripts should be placed, and if present they will be invoked before and after the backup runs. The pre-command is known as the pre-freeze script, while the post-command is the post-thaw script.</p> <h2 data-id="cause">Cause</h2> <p>Some applications may not back up in a consistent state with a normal VMware backup.</p> <h2 data-id="resolution">Resolution</h2> <p>To quiesce the application before a vProtect backup runs, a prerequisite is that VMware tools are installed in the VM. Then, you need to create a pre-freeze and post-thaw script that will run before and after the backup runs.</p> <p>For Windows VMs, please see <a rel="nofollow" href="/home/leaving?allowTrusted=1&target=http%3A%2F%2Fkb.vmware.com%2Fselfservice%2Fmicrosites%2Fsearch.do%3Flanguage%3Den_US%26cmd%3DdisplayKC%26externalId%3D1006671">this Knowledge Base article from VMware</a> that describes the directory location of the scripts per ESX/ESXi version and also provides more information about execution order if you want to quiesce multiple applications, format of the scripts, etc.</p> <p>For Linux VMs, the scripts should be named</p> <p> /usr/sbin/pre-freeze-script</p> <p> /usr/sbin/post-thaw-script</p> <p> </p> <p>Both must have 0755 permissions so that they are executable, and should be owned by <i>root</i>.</p> </article> </main>