Tasks and Task Scheduler for MongoDBMongoDB的任务和任务调度器

Posted on: 14/02/2020 (last updated: 09/03/2022) by Ricardo Pires
tl;dr

Tasks lets you configure and save frequently-run imports, exports, data comparisons, migrations, Reschema, and data masking jobs so you can later run them with one click.通过“任务”,您可以配置和保存经常运行的导入、导出、数据比较、迁移、重新扫描和数据屏蔽作业,以便以后只需单击一下即可运行这些作业。

Task Scheduler takes it up a notch by adding a scheduling functionality so they are run automatically, whenever you need.“任务调度器”通过添加一个调度功能将其提升到了一个新的高度,以便在需要时自动运行。

Try both today.今天两种都试试。

Automate MongoDB tasks自动化MongoDB任务

Tasks and Task Scheduler help you automate repetitive MongoDB jobs by allowing you to configure, save, and schedule tasks and run them as needed.“任务”和“任务调度器”允许您配置、保存和调度任务,并根据需要运行它们,从而帮助您自动化重复的MongoDB作业。

After saving your frequently-run jobs, you can run them on-demand using Tasks, or run them automatically using Task Scheduler. 保存频繁运行的作业后,可以使用“任务”按需运行它们,或使用“任务调度器”自动运行它们。

https://player.vimeo.com/video/683825165

Tasks and Task Scheduler currently support these tasks. 任务和任务计划程序当前支持这些任务。What you can automate or schedule will depend on your Studio 3T edition.你可以自动化什么或安排什么将取决于你的Studio 3T版本。

  1. Import Wizard导入向导 (all Studio 3T editions)
  2. Export Wizard导出向导 (all Studio 3T editions)
  3. Data Compare & Sync数据比较和同步 (Pro and Ultimate only)
  4. Reschema (Pro and Ultimate only)
  5. Data Masking数据屏蔽 (Ultimate only)
  6. SQL MigrationSQL迁移 (Ultimate only)

Studio 3T must be running at the scheduled time in order for any scheduled task to run.Studio 3T必须在计划时间运行,才能运行任何计划任务。

Download the latest Studio 3T version and automate your first task.下载最新的Studio 3T版本,并自动完成第一项任务。

Open Tasks打开“任务”

  1. Go to the Studio 3T global toolbar and click on the Tasks button.转到Studio 3T全局工具栏并单击“任务”按钮。
  2. This will open up the Tasks dialog, which provides an overview of all previously-saved tasks.这将打开“任务”对话框,其中概述了以前保存的所有任务。

Create a task创建任务

To create a task, click on the New Task button. 要创建任务,请单击“新建任务”按钮。This will open the New Task dialog:这将打开“新建任务”对话框:

The dialog displays all the possible types of tasks you can create:该对话框显示您可以创建的所有可能的任务类型:

Select the task type and click OK. 选择任务类型并单击“确定”。This will close the current dialogs and trigger the appropriate tab – depending on the task type – where you can continue to configure and save the task.这将关闭当前对话框并触发相应的选项卡(取决于任务类型),您可以在其中继续配置和保存任务。

Here are the links to the relevant documentation:以下是相关文档的链接:

Save a task保存任务

On top of each task tab is a toolbar with three buttons:每个任务选项卡上都有一个工具栏,其中有三个按钮:

It is not possible to save or execute a partially configured task.无法保存或执行部分配置的任务。

After saving the task, it will be visible in the Task Overview dialog:保存任务后,它将在“任务概述”对话框中可见:

Execute a task执行任务

  1. Select any number of tasks in the Task Overview dialog.在“任务概述”对话框中选择任意数量的任务。
  2. Click the Execute button, or right-click on the task(s) and choose Execute. 单击“执行”按钮,或右键单击任务并选择“执行”。Studio 3T will then execute the task with the saved configuration.然后,Studio 3T将使用保存的配置执行任务。

You can track the progress of import jobs in the Operations panel. 可以在“操作”面板中跟踪导入作业的进度。For Data Compare & Sync jobs, a Comparison Results tab will automatically open.对于“数据比较和同步”作业,将自动打开“比较结果”选项卡。

Find a task查找任务

You can search for and filter your saved tasks in the Task Overview dialog using the search bar on top.您可以使用顶部的搜索栏在“任务概述”对话框中搜索和筛选保存的任务。

Edit a task编辑任务

  1. Select any number of entries in the Task Overview dialog.在“任务概述”对话框中选择任意数量的条目。
  2. Click the Edit button, or right-click on the task(s) and choose Edit. 单击“编辑”按钮,或右键单击任务并选择“编辑”。This will bring up the corresponding tab, filled with the saved configuration.这将显示相应的选项卡,其中填充了已保存的配置。

Clone a task克隆任务

  1. Choose any number of entries in the Task Overview dialog.在“任务概述”对话框中选择任意数量的条目。
  2. Click the Clone button, or right-click on the task(s) and select Clone. 单击“克隆”按钮,或右键单击任务并选择“克隆”。A copy will be created for each selected Task, under the name “Copy of <task name>”.将为每个选定任务创建一个副本,名称为“<任务名称>的副本”。

Delete a task删除任务

  1. Choose any number of tasks in the Task Overview dialog.在“任务概述”对话框中选择任意数量的任务。
  2. Click on the Delete button, or right-click on the task(s) and press Delete. 单击“删除”按钮,或右键单击任务并按“删除”。The user will asked to confirm the deletion, after which the tasks will be deleted.用户将被要求确认删除,之后任务将被删除。

Schedule MongoDB tasks安排MongoDB任务

Task Scheduler is the complementary feature to Tasks, which lets you schedule jobs to be executed automatically at specified times.“任务调度器”是任务的补充功能,它允许您在指定时间自动执行任务。

In order to trigger the scheduled task, Studio 3T must be running at the scheduled time, otherwise the task won’t be run.为了触发计划任务,Studio 3T必须在计划时间运行,否则任务将不会运行。

To schedule a task, open the Task Overview dialog.要安排任务,请打开“任务概述”对话框。

Double-click in the Schedule cell of the target task. 双击目标任务的“计划”单元格。This cell is initially empty, meaning that the task hasn’t been scheduled.此单元格最初是空的,这意味着任务尚未安排。

This will trigger the Task schedule editor, which allows you to schedule the task. 这将触发“任务计划编辑器”,允许您计划任务。You can choose to run the task everyday:您可以选择每天运行任务:

Once at the specified time:在指定时间进行一次:

Or regularly on the days and time you specify:或者定期在您指定的日期和时间:

Configure the schedule as desired and click Save. 根据需要配置计划,然后单击“保存”。The task is now scheduled to run:任务现在计划运行:

Server-side MongoDB job automation服务器端MongoDB作业自动化

Are you interested in running MongoDB jobs on your server? 您对在服务器上运行MongoDB作业感兴趣吗?Help us shape the future of job automation for MongoDB and let us know what you’d like to get done.帮助我们塑造MongoDB工作自动化的未来,让我们知道您希望完成什么。

Check out Studio 3T’s other time-saving features:查看Studio 3T的其他省时功能: