How to automate DrTool file as a scheduled task

It is possible to use the DrTool to create a DrTool file from a destination URI. This can take some time for very large destinations, but it is done via the query argument.

Example:

This can be automated as follows:

  1. Have a scheduled task create a DrTool file in a batch operation.
  2. Have that file immediately posted to Swarm storage for long-term retention.

Here's an example PowerShell script which would create a DrTool file from destination and then post it to a CloudScaler bucket. Once posted, the script removes the generated file. 

#################Begin Script####################################

$drtoolfile = 'C:\Program Files\Caringo FileFly\AdminTools\DrTool\Drtool.bat'
$a = (Get-Date -Format yyy-mm-dd-hhmm)
$filename = "c:\" + $a + ".txt"
$domain = "cloudscaler://filefly.ecorp.com/testdomain1.ecorp.com/fileflydata/"
$arguments = "-query $domain $filename"

#######################
$username = "<yourusername that has permission to write to the storage goes here>"
$password = "<password for the same user>" | ConvertTo-SecureString -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($username,$password)

Start-Process -Wait -NoNewWindow $drtoolfile $arguments 
Invoke-WebRequest -Uri http://testdomain1.ecorp.com/drtoolruns/$filename -Method Post -InFile $filename -Credential $cred | Out-File C:\log.txt -Append


Remove-Item $filename

##################################################################

Then we can use a Windows Scheduled Task to automate the run. 

This is the full line for the arguments above:

"-ExecutionPolicy Bypass C:\Users\Administrator.ECORP\Documents\createdrtoolfilefromdest.ps1"

Important

Because this Destination is small, it is manageable to run it as a daily task. However, in most production environments, the DrTool creation can take 3-4 days, so once every one or two weeks would be optimal.


© DataCore Software Corporation. · https://www.datacore.com · All rights reserved.