How to use a pre-backup or post-backup script to reset the archive bit in System Center Data Protection Manager
Published Feb 15 2019 04:10 AM 613 Views
First published on TECHNET on Oct 13, 2010

Here's a good tip you might find handy.  Let's say you have a situation where you have a legacy application or some other need that requires the archive bit to be reset for data which is being backed up. Given the fact that DPM does not use the Archive bit but instead uses the USN Change journal you will have to accomplish this using a Pre-Backup or Post-Backup script.

In the following example I use a Post-Backup script to set the Archive bit on all the files in C:\DataDirectory recursively after the backup is done:

1. Edit the "%programfiles%\Microsoft Data Protection Manager\DPM\Scripting\ScriptingConfig.xml" to have the following contents on the Protected Server:

<?xml version="1.0" encoding="utf-8"?>
<ScriptConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns="http://schemas.microsoft.com/2003/dls/ScriptingConfig.xsd";>
<DatasourceScriptConfig DataSourceName="C:\DataDirectory">
<PostBackupScript>"C:\SetAcrhiveBit.cmd"</PostBackupScript>
<TimeOut>30</TimeOut>
</DatasourceScriptConfig>
</ScriptConfiguration>

2. Create a script in C:\SetAcrhiveBit.cmd locally on the Protected Server to have the following contents:

cd /d C:\DataDirectory
attrib  /S  +A      *

That's it!

Please note that the "DataSourceName" attribute in the ScriptingConfig.xml must match the name of the datasource as displayed in the DPM Administrative Console. In addition, if you have multiple datasources on a protected server which require a Pre/Post backup script then you must make additional entries in the ScriptingConfig.xml file using the XML blob as shown above with spaces between each and pay careful attention to specify the correct name for the datasource in the "DataSourceName" attribute as well as the "PostBackupScript" or "PreBackupScript" attribute to point to the correct location of the script which needs to be executed.

Note: This applies to DPM 2007 as well as DPM 2010.

For more information about how to use pre-post scripts for different data-sources please see the following TechNet documentation:

http://technet.microsoft.com/en-us/library/bb808870.aspx

Tyler Franke | Senior Support Escalation Engineer

The App-V Team blog: http://blogs.technet.com/appv/
The WSUS Support Team blog: http://blogs.technet.com/sus/
The SCMDM Support Team blog: http://blogs.technet.com/mdm/
The ConfigMgr Support Team blog: http://blogs.technet.com/configurationmgr/
The OpsMgr Support Team blog: http://blogs.technet.com/operationsmgr/
The SCVMM Team blog: http://blogs.technet.com/scvmm/
The MED-V Team blog: http://blogs.technet.com/medv/
The DPM Team blog: http://blogs.technet.com/dpm/
The OOB Support Team blog: http://blogs.technet.com/oob/
The Opalis Team blog: http://blogs.technet.com/opalis

1 Comment
Version history
Last update:
‎Mar 11 2019 08:34 AM
Updated by: