Email Data Feed – Schedule Python Script with Windows Task Scheduler
search cancel

Email Data Feed – Schedule Python Script with Windows Task Scheduler

book

Article ID: 172981

calendar_today

Updated On: 06-10-2025

Products

Email Security.cloud Email Threat Detection and Response

Issue/Introduction

This article guides you through automating your Email Data Feed by scheduling a Python script using Windows Task Scheduler.

Environment

 

  • Email Security.cloud

  • Email Threat Detection and Response

  • Data feed 

 

 

Resolution

Python is installed on your system (recommend Python 3.8+).

A working NdfConfig.json file with properly defined feed-types (e.g., test, all, malware, isolation, spam, etc).

Absolute paths are configured in NdfConfig.json, cookie directories, and log outputs.

 

 

 

To schedule different calls for various jobs, create separate files for scripts and JSON configurations for all tasks or malware. For example, use names like `allNdfConfig.json` and `allNdfScript.py` for general tasks, and `malwareNdfConfig.json` and `malwareNdfScript.py` for malware-related tasks.

 

In the `NdfScript.py` file, ensure that the call to the `NdfConfig.json` file includes the absolute path. Edit the Python script `NdfScript.py` to incorporate the absolute path for the corresponding configuration file, `NdfConfig.json`.

 

 

 

Scheduling with Task Scheduler

A. Open Task Scheduler

Windows → type Task Scheduler → open Task Scheduler.

B. Create a New Scheduled Task

  1. Action: Create Basic Task

  2. Trigger: Choose a schedule (daily, hourly, etc.)

  3. Action: Start a program

    • Program/script: path to your Python executable (e.g., C:\Python39\python.exe)

    • Add arguments:

      "C:\NdfConfig\allNdfScript.py"

    Ensure both script and config paths are absolute and enclosed in quotes.

  4. Finish the wizard. Repeat these steps for any additional feeds (e.g., malware).