Skip to content
Documentation

Task Scheduler

Two complementary surfaces: an in-app scheduler for one-off jobs (Ctrl+Alt+S) and an OS-level scheduler that registers cron / launchd / Windows Task Scheduler entries with the bundled `nbcli` helper (Ctrl+Alt+Shift+K).

What it is

Schedule recurring DBA chores — mongodump, mongoexport, custom shell scripts — from the NoSqlStudio UI. The in-app scheduler runs while the app is open; the OS scheduler hands the job off to your operating system's native scheduler so it runs even when the app is closed.

When to use

Use the in-app scheduler for one-off / dev-time runs. Use the OS scheduler for production-grade backups, recurring exports to S3, weekly mask-and-refresh jobs, or anything that must survive a workstation reboot.

How to open

  1. In-app jobs — open Tools menu → Tasks Scheduler, or press Ctrl+Alt+S.
  2. OS jobs — open Tools menu → OS Task Scheduler, or press Ctrl+Alt+Shift+K.
  3. Each opens a workspace tab with a list of registered tasks + a New Task button.

Building an OS task

  1. Pick a task type: mongodump, mongoexport, shell script, or one of the predefined templates (mask-and-copy, schema-diff-report, audit-export).
  2. Pick a schedule: hourly / daily / weekly / monthly / cron expression (e.g. `0 2 * * *` for every night at 02:00).
  3. Pick start / end window (optional). The OS scheduler arms the job only inside this window.
  4. Fill the task-specific arguments (target connection, output directory, --collection filter, etc.). The `{date}` placeholder expands at execution time so each run writes a uniquely-named artifact.
  5. Click Register. NoSqlStudio writes the OS-native entry: on Windows uses `schtasks.exe`, on macOS writes a `~/Library/LaunchAgents/...plist`, on Linux writes `~/.config/cron.d/` + a systemd timer if available.

The `nbcli` helper

OS scheduler tasks call `nbcli` (NoSqlStudio CLI), a bundled binary that runs your job from the command line without needing the UI. It reads its arguments via base64-encoded JSON, executes via spawn, writes its own audit lines directly to `userData/AuditLog/audit.jsonl`, and rotates its log under `userData/OsTaskSchedules/nbcli.log`.

Audit

Every OS task emits `os-task.start` and `os-task.finish` audit lines (success / failure outcome). The in-app log workspace shows these alongside DataMask / DB Copy lines — same source for forensic investigation.

Limitations (v1)

  • OS scheduler requires `nbcli` to be in your PATH (the installer drops the wrapper in the app exe dir; macOS `.app` bundles may need a symlink). Mongo tools (`mongodump`, `mongoexport`) must also be in PATH or in `NBCLI_MONGO_TOOLS_DIR`.
  • Cross-machine sync — schedules are local. Use a config-management tool (Chef / Ansible / SCCM) to push templates if you need fleet-wide consistency.
  • Failure notifications use the same Alerting webhooks. If you have no webhooks configured, failures land silently in the audit log.