IMPORTANT, this is an experimental feature
The following feature was implemented for our own internal use, however, we have decided to make it available to users. As such it is very experimental, and must be used with that in mind. If you have issues with the feature or have suggestions on improving the feature, please let us know.
What are Sync Actions?
Sync file actions allow a user to define some external action to take place when certain actions occur. For example, if a file gets copied to a provider, you can call an external process to perform some specific task such as record the copied file to a database, or kick off some other process.
This initial version of the feature is very limited and requires some technical know how to get running. It requires manually registry modification of a provider rule (there is no way to add/alter this feature from the client).
Format
Version|TimeEvent|FileAction|Option(s)|Command|Directory|OptionalComment
Examples
1|PreSync|DeleteFile|NO|"C:\MyProgram.exe /f {local-filename}"|C:\|This is called before a remote file is deleted, and passes the local file name.
Time event
PreSync: Event called before the sync action.
PostSync: Event called after the sync action.
File action
CopyToRemote: Called before/after a file is copied to a remote service.
CopyToLocal: Called before/after a file is copied to the local machine.
DeleteFile: Called before/after a file is deleted.
RenameFile: Called before/after a file is renamed.
Options (currently there are no options defined).
NO: No options
Command & variables
{time-event}: This will be the time event such as "PreSync"
{file-action}: This will be the file action such as "DeleteFile"
{local-filename}: The local file name including the path (this is specified using the volume GUID of the drive).
{local-filename-lastwrite}: The local file's last write date.
{provider-id}: The provider id of the cloud provider.
{rule-id}: The provider rule id.
{provider-name}: The provider name of the cloud provider.
{rule-name}: The provider rule name.
Adding a Sync Action
First, you need to find the provider rule you want to modify. Using regedit, head to "HKEY_LOCAL_MACHINE\SOFTWARE\Division-M\Cloud Xtender", then look for a subkey with the appended value of ".PLACEMENTRULE" (make sure you have found the correct rule, maybe ensure the name matches). Add a string value called "Sync Actions" and then add the desired actions. For multiple actions, use a ; value to separate.
Some important notes. If you are testing this feature, the Sync Actions value is only parsed during startup. To make testing faster, add the registry DWORD value "Sync Actions Refresh" and set it to 1, this will force CX to parse the sync actions every time (note this value is set to 0 upon a restart of the CX service).
What we have planned
If we get enough interest in this feature, we have a few planned additions.
* GUI interface to allow better management.
* Abort a sync based on a return value (you will not be able to cancel the sync, just delay it).
* Specifing a user context under which the action is run.
* Additional parameters and file actions.
Comments
0 comments
Article is closed for comments.