Scheduling Exports

You can automate backups by scheduling the CLI to run at specific intervals.

Windows (Task Scheduler)

  1. Create a PowerShell script (export.ps1):

    $Date = Get-Date -Format "yyyy-MM-dd"
    ./DiscordChatExporter.Cli.exe export -t "TOKEN" -c 12345 -o "C:\Backups\$Date.html"

  2. Open Task Scheduler.

  3. Create Basic Task -> Set Trigger (e.g., Daily).
  4. Action: Start a Program.
    • Program: powershell
    • Arguments: -File "C:\path\to\export.ps1"

Linux / macOS (Cron)

  1. Create a shell script (export.sh) and make it executable (chmod +x):

    #!/bin/bash
    cd /path/to/dce
    ./DiscordChatExporter.Cli export -t "TOKEN" -c 12345 -o "/backups/%d-chat.html"

  2. Edit crontab:

    crontab -e

  3. Add a line to run daily at midnight:

    0 0 * * * /path/to/export.sh