Scheduling Exports
You can automate backups by scheduling the CLI to run at specific intervals.
Windows (Task Scheduler)
-
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" -
Open Task Scheduler.
- Create Basic Task -> Set Trigger (e.g., Daily).
- Action: Start a Program.
- Program:
powershell - Arguments:
-File "C:\path\to\export.ps1"
- Program:
Linux / macOS (Cron)
-
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" -
Edit crontab:
crontab -e -
Add a line to run daily at midnight:
0 0 * * * /path/to/export.sh