DATASTOR backup options for the OneDrive folder

 

DATASTOR protection plans do not scan files located in cloud storage. To process OneDrive files and folders, a local copy must be present on the local disk. Otherwise, each OneDrive file returns a warning that access to the cloud file is denied. See an example from the log entry below.

WARNING: Cannot archive C:\Users\paula\OneDrive - my company\Microsoft Teams Chat Files\stuff to buy.xlsx - item skipped.
Unable to open the file
Reason: Access to the cloud file is denied. (395L)

To set OneDrive to keep a local copy of a folder, open OneDrive in File Explorer, right click the desired folder, or the OneDrive folder itself, and click the option 'Always keep on this device'. See image.

You must have disk space available to keep the files locally. 

Exclude OneDrive

You may not wish to back up OneDrive files if you have a copy kept both locally and in the cloud, Or, you may not have disk space available to keep a local copy. In this case, to prevent the protection plan warnings you can exclude the OneDrive folder from the backup. If you are running a Files and Folders type plan, use the plan settings to exclude the OneDrive folder. For a Computer System type plan, specify an exclusions file.

Files and Folders plan

The Files and Folders plan settings allow you to exclude the OneDrive folder. Highlight the protection plan, then click 'Plan Settings...' from the right pane. On the Folders tab of Plan Settings, click the Add button. See image.

 In the dialog box, select the exclude radio button, then browse to C:\Users\[the user]\[the OneDrive folder]. Click OK to add the exclusion. See image.

Note that the OneDrive folder path is followed by a backslash indicating a folder is specified rather than a file. Click OK to save and close the settings window.

Computer System plan

The Advanced Settings of the Computer System plan type contains an Exclusions field where a custom exclusion file may be defined to exclude the OneDrive folder from the backup. To set the plan to use a OneDrive exclusion file, follow the steps below. 

  • The OneDrive folder name is required for the exclusion file. For a personal account, the folder name is OneDrive. For an Office365 subscription, the name is in the format [OneDrive - MY LONG COMPANY NAME LLC], as defined when the Office 365 account was created. The default OneDrive folder location is under C:\Users\[your account]\. You can browse to the folder location to find the OneDrive folder name for your exclusion file. You may also review the plan log with the warning and the full path to the OneDrive folder.
  • Download the attached OneDriveExcludes.xml file.
  • Edit the OneDriveExclusions.xml file in notepad.
  • In notepad, edit the <exclude> line so the path="" entry matches the OneDrive folder name at C:\Users\[your account]. See below for an example. Use your own folder name.

<exclude name="OneDrive" path="C:\Users\*\OneDrive - DataStorageGroup\" subfolders="true" />

  • Note that the exclusion file uses a wildcard (*) so that all OneDrive folders for all users are excluded. You may define an explicit path for a single user if desired. End the path with a backslash to indicate a folder rather than a file.
  • Save the edited file and close notepad.
  • Copy OneDriveExclusions.xml into the software installation folder's Configurations subfolder. The default path is "c:\Program Files\DATASTOR\DATASTOR Shield Enterprise Protection Server\Server\Configurations" but you may have installed to a different location.
  • Highlight the protection plan and click 'Advanced Settings'. Scroll up to the Exclusions field and enter Configurations\OneDriveExcludes.xml and click OK to save and close the Advanced Settings window.

   

OneDriveExcludes.xml