Creating File Sync Rules


File sync rules allow you to synchronize files and folders between your devices and a server. File collection, also referred to as file uploading, is a very convenient method for gathering information from devices, for example a transaction log file. File dissemination, also referred to as file downloading, is a quick and easy way to send one or more files to a set of devices such as an updated product listing or configuration file.

  1. Start the wizard.

    Select the Rules view (tab), then click Rule, point to Create Rule, and click File Sync Rule. Enter a meaningful name for the rule.

  2. First page of the Create File Sync Rule Wizard

  1. Configure file synchronization source and destination.
  2. Configure file sync source and destination

    The following table describes the fields of this page of the wizard:

    Field Name Description
    Direction
    • Upload (File collection) The rule will be used to upload files from the devices to a server.
    • Download (File dissemination) The rule will be used to download files from the server to devices.
    Device File/Folder Specifies the complete file system path to the files or folders being synchronized on the device
    Server File/Folder

    Note:

    It is important that the Deployment Servers have sufficient permission to read and write to the source or destination UNC path. Best practice is to run the Deployment Server under its own Active Directory user profile.

    Specifies the complete file system path to the files or folders being synchronized on the server

    It is strongly recommended that a UNC (Universal Naming Convention) path be used. A local path (i.e. C:\MyFiles) can be used if only one Deployment Server is being used and the local path is on the computer running the Deployment Server.

    Server-side Folder Options

    For upload rules, files collected from the devices can be written to:

    • A single shared folder, meaning files could potentially be overwritten if they have the same name.
    • A per-device subfolder, named using the device ID (i.e {00135304-41D7-019E-5800-0050BF3F5173})
    • A per-device subfolder, named using the device tree path (i.e. .\Management Devices\Device 0001)

    For download rules, files disseminated from the server can be read from:

    • A single shared folder, meaning all devices get the same file(s).
    • A per-device subfolder, named using the device ID (i.e. {00135304-41D7-019E-5800-0050BF3F5173})
    • A per-device subfolder, named using the device tree path (i.e. .\Management Devices\Device 0001)

    When the Create folder(s) immediately after rule is saved option is enabled, the server-side folders will be created immediately after the file sync rule is saved. This allows adding files to the folders on the servers that are synchronized with the devices when the file sync event occurs.

  1. Select devices.
  2. Select the device(s) and group(s) for which the file sync rule will apply.

    Device Group selection page

  1. Specify the synchronization options.
  2. The following table describes the file synchronization options on this page of the Create File Sync Rule Wizard:

    Field Name Description
    Delete Source File After Sync (This applies only to upload rules.) When selected, the source file(s) on the device are transmitted to the server and then deleted from the device.
    Only Transmit File(s) when
    • The Always Transmit option will cause file(s) to be uploaded or downloaded regardless of whether or not the source and target are different or the same.

    • The Files are different option will cause file(s) to be uploaded or downloaded only if the source file is different from the destination file.

    • The Source file is newer option will cause file(s) to be uploaded or downloaded only if the source file has a more recent date-time stamp.

    • The Destination file does not exist option will cause file(s) will cause file(s) to be uploaded or downloaded only if the destination file does not exist.

    Sync Sub-Folders Synchronize files in sub-folders in addition to the files located in the target folder
    Sync Online Devices Now

    File synchronization will be executed immediately following the completion of the wizard for online devices.

    Sync On Device Addition or Relocation

    Perform file synchronization when a device is added or relocated to a device tree group for which this rule has been configured

    This setting is useful to easily invoke file synchronization when a device is moved from one group to another in the device tree.

    Network Restriction Restrict whether file synchronization should take place over cellular data networks (i.e. GPRS)
    Upload File Name Format

    Allows you to customize the names of the files that are uploaded from the devices

    For example, you can augment a file name with the date-time stamp of when it was uploaded. These are available file-name macros:

    • %YYYY% is for the year (e.g. 2006).
    • %MM% is for the month of year (e.g. 12 is December).
    • %DD% is for the day of month (e.g. 31).
    • %H% is for the hour in the 24-hour format (e.g. 14).
    • %M% is for the minutes (e.g. 30).
    • %S% is for the seconds (e.g. 55).
    • %FILENAME% is for the original file name (e.g. mylogfile).
    • %EXTENSION% is for the original file extension (e.g. .txt).
    Use Common Cache Mode

    The option to use the new, advanced caching mode of the files being disseminated is applicable only when syncing files from the server to the device.

    This option is set to Yes by default. When enabled, a single, shared, cached copy of each file being disseminated is stored on the Deployment Server. If you are experiencing issues with file synchronization, set this option to No.

    File synchronization options

    Click the Scripts button to configure file synchronization scripts.

    File Synchronization Scripts

    File synchronization scripts provide flexibility in automating actions on the device pre or post file synchronization. For example: Before collecting a log file from the device, stop a certain running process (e.g. kill abc.exe). After the file has been collected, restart the process (e.g. start abc.exe). Please see the Script Command Set page and the Script Variables page.

    File synchronization advanced options

    Field Name Description
    Always execute Will execute the script every time there is a scheduled sync, even if the files are updated or not
    Only execute if files transmitted

    Will execute the script when files have been updated by the sync schedule

    Browse Will allow you to import previously created scripts
  1. Specify the synchronization and activation or deactivation schedule.
  2. Rule activation schedule

    Field Name Description
    Use Device Update Schedule By default, the device update schedule (specified by the add devices rule used to add the devices to the system) triggers file synchronization
    Use Specified File Sync Schedule

    If you specify a file synchronization schedule in this dialog box, only that schedule will be used, and the device synchronization schedule will not trigger file synchronization. To Specify the custom schedule click the Add button. Please see the File Synchronization Schedule page for more information about creating a custom file sync schedule.

    By default, the file sync rule will be activated immediately upon completion of the wizard. If you wish to delay the activation you can modify the activate date. A deactivate date can optionally be entered to specify a date from which the rule will be disabled. A file sync rule can also be explicitly disabled by clearing the Enable Rule check box.

  1. Review summarized information.

    Review information on the Add devices rule summary page. This page gives you an opportunity to review the settings of the file sync rule before committing them. If you wish to make any corrections, click the Back button.

Summary page