Schedule an import of your data

Data Manager is included in all Service Collection Premium and Enterprise plans.

Use scheduling tools to run the Cleanse and Import client at regular intervals and automatically update Data Manager objects.

Examples on this page use:

  • cron on macOS and Linux

  • Windows Task Scheduler on Windows/DOS

Any scheduling app can be used, provided the Cleanse and Import client command is configured correctly.

If files must be copied to a server before being consumed, set up additional scheduled tasks to move the files. Leave sufficient time (for example, 1 hour) between scheduled tasks to avoid overlap.

Import your data using the Cleanse and Import client with cron (macOS and Linux)

Prerequisites

  • All data sources linked to the object class you are importing must be mapped and cleansed.

  • The Cleanse and Import client must be installed.

  • You must have:

    • a Cleanse and Import token, and

    • your Workspace ID.

To schedule the Cleanse and Import client with cron:

  1. Open a terminal (for example, Applications > Utilities > Terminal on macOS).

  2. Navigate to the Cleanse and Import client directory:

    cd /path/to/assets-cleanse-and-import-client

    (Replace with your actual path; the client binary is dm-cleanseimport.)

  3. Create a script to run the client:

    nano import-script.sh
  4. Add the command (you need your Workspace ID and a Cleanse and Import token):

    #!/bin/bash ./dm-cleanseimport --workspace-id <workspaceId> --token <your-token> --run full

    Use double quotes (") to wrap any data source names that contain spaces.

  5. Save the script.

  6. Make it executable:

    chmod +x import-script.sh
  7. Edit the crontab:

    crontab -e

    To edit another user’s crontab:

    crontab -u [username] -e
  8. Add a cron expression and script path:

    [cron-expression] /path/to/import-script.sh

    Cron expression format:

    • [minute: 0-59] [hour: 0-23] [day: 1-31] [month: 1-12] [weekday: 0-6]

    • 0 in weekday is Sunday; 1 is Monday, and so on.

    Special characters:

    • * – all values

    • / – steps (for example, */2 in the day field means “every second day”)

    • - – range (for example, 1-3 in the month field means January to March)

    • , – list (for example, 1,3 in the weekday field means Monday and Wednesday)

  9. In vi or vim, press i to enter insert mode, add the line, then press Esc, type :x, and press Enter to save and exit.

Example to run every Tuesday and Thursday at 6 p.m.:

0 18 * * 2,4 /Users/[username]/import-script.sh
  1. To list cron jobs:

crontab -l

Import your data using the Cleanse and Import client with Windows Task Scheduler

Prerequisites

  • All data sources linked to the object class you are importing must be mapped and cleansed.

  • The Cleanse and Import client must be installed.

To schedule the Cleanse and Import client in Windows Task Scheduler:

  1. Open Task Scheduler.

  2. Create a subfolder, for example Data Manager.

  3. Select Create task….

  4. On the General tab:

    • Provide a meaningful name (for example, Import Data Manager Objects).

    • Select Run whether user is logged on or not.

    • Select Change user or group and choose a service account.

Using a service account allows the task to run independently of any individual user.

  1. On the Triggers tab, select New… and configure when the task should run (daily, weekly, time of day, etc.), then select OK.

  2. On the Actions tab, select New…:

    • Action: Start a program

    • Program/script: dm-cleanseimport.exe

    • Add arguments (optional) – include:

      • Workspace ID: --workspace-id e44regc98-8d2r-3af7-011t-209p44716366

      • Cleanse and Import token: --token <your-cleanse-import-token>

      • Operation(s) to run:

        • --run cleanse

        • --run import

        • --run full (to run both)

      Example:

      --workspace-id e44regc98-8d2r-3af7-011t-209p44716366 --token <your-token> --run full
    • Start in (optional) – folder where dm-cleanseimport.exe resides (for example, C:\path\to\assets-cleanse-and-import-client).

  3. On the Settings tab:

    • Change Stop the task if it runs longer than from 3 days to something more appropriate (for example, 1 hour).

  4. Select OK.

  5. If prompted, enter the password for the service account and save the task.

The task will run at the scheduled times. You can test it by selecting the task and choosing Run.

Still need help?

The Atlassian Community is here for you.