データのインポートをスケジュールする
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)
前提条件
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:
Open a terminal (for example, Applications > Utilities > Terminal on macOS).
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.)Create a script to run the client:
nano import-script.shAdd the command (you need your Workspace ID and a Cleanse and Import token):
#!/bin/bash ./dm-cleanseimport --workspace-id <workspaceId> --token <your-token> --run fullUse double quotes (
") to wrap any data source names that contain spaces.スクリプトを保存します。
Make it executable:
chmod +x import-script.shEdit the crontab:
crontab -eTo edit another user’s crontab:
crontab -u [username] -eAdd a cron expression and script path:
[cron-expression] /path/to/import-script.shCron expression format:
[minute: 0-59] [hour: 0-23] [day: 1-31] [month: 1-12] [weekday: 0-6]0in weekday is Sunday;1is Monday, and so on.
Special characters:
*– all values/– steps (for example,*/2in the day field means “every second day”)-– range (for example,1-3in the month field means January to March),– list (for example,1,3in the weekday field means Monday and Wednesday)
In
viorvim, pressito enter insert mode, add the line, then pressEsc, 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.shTo list cron jobs:
crontab -lImport your data using the Cleanse and Import client with Windows Task Scheduler
前提条件
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:
Open Task Scheduler.
Create a subfolder, for example Data Manager.
Select Create task….
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.
On the Triggers tab, select New… and configure when the task should run (daily, weekly, time of day, etc.), then select OK.
On the Actions tab, select New…:
Action:
Start a programProgram/script:
dm-cleanseimport.exeAdd arguments (optional) – include:
Workspace ID:
--workspace-id e44regc98-8d2r-3af7-011t-209p44716366Cleanse and Import token:
--token <your-cleanse-import-token>Operation(s) to run:
--run cleanse--run import--run full(to run both)
例:
--workspace-id e44regc98-8d2r-3af7-011t-209p44716366 --token <your-token> --run fullStart in (optional) – folder where
dm-cleanseimport.exeresides (for example,C:\path\to\assets-cleanse-and-import-client).
On the Settings tab:
Change Stop the task if it runs longer than from
3 daysto something more appropriate (for example,1 hour).
[OK] を選択します。
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.
この内容はお役に立ちましたか?