|
|
|
# Operations
|
|
|
|
|
|
|
|
## Daily Operations
|
|
|
|
|
|
|
|
### Starting the Scheduler
|
|
|
|
|
|
|
|
**Production (Windows Task Scheduler):**
|
|
|
|
- Configure Windows Task Scheduler to run `daily_scheduler.py` at startup
|
|
|
|
|
|
|
|
**Manual Start:**
|
|
|
|
```bash
|
|
|
|
python daily_scheduler.py
|
|
|
|
```
|
|
|
|
|
|
|
|
### Monitoring
|
|
|
|
|
|
|
|
**Check Scheduler Status:**
|
|
|
|
```bash
|
|
|
|
python utils/check_scheduler_status.py
|
|
|
|
```
|
|
|
|
|
|
|
|
**View Master Summary Log:**
|
|
|
|
- Location: `D:\automated-email-migration\logs\daily_summary\YYYY-MM-DD_master_summary.log`
|
|
|
|
- Contains daily summary of all operations
|
|
|
|
|
|
|
|
**Check Database:**
|
|
|
|
```bash
|
|
|
|
python utils/run_sql.py "SELECT * FROM migration_queue LIMIT 10"
|
|
|
|
```
|
|
|
|
|
|
|
|
### Common Tasks
|
|
|
|
|
|
|
|
**View Today's Batches:**
|
|
|
|
```bash
|
|
|
|
python utils/run_sql.py "SELECT * FROM migration_batch WHERE DATE(created_at) = DATE('now')"
|
|
|
|
```
|
|
|
|
|
|
|
|
**Check Migration Status:**
|
|
|
|
```bash
|
|
|
|
python utils/run_sql.py "SELECT status, COUNT(*) FROM migration_queue GROUP BY status"
|
|
|
|
```
|
|
|
|
|
|
|
|
**Verify Settings:**
|
|
|
|
```bash
|
|
|
|
python utils/check_live_safety.py
|
|
|
|
```
|
|
|
|
|
|
|
|
## Utility Scripts
|
|
|
|
|
|
|
|
All utility scripts are located in the `utils/` folder:
|
|
|
|
|
|
|
|
- `check_scheduler_status.py` - Check if scheduler is running
|
|
|
|
- `check_live_safety.py` - Verify settings before live execution
|
|
|
|
- `run_sql.py` - Execute SQL queries on database
|
|
|
|
- `clear_all_data.py` - Clear all migration data (use with caution)
|
|
|
|
- `reset_cursor.py` - Reset Bohrium API cursor
|
|
|
|
|
|
|
|
## Master Summary Log
|
|
|
|
|
|
|
|
The master summary log provides a daily summary of all operations:
|
|
|
|
|
|
|
|
- Queue sync status and user count
|
|
|
|
- Batch creation details
|
|
|
|
- Email sending status
|
|
|
|
- AD group management results
|
|
|
|
- GCDS sync status
|
|
|
|
- Migration execution summary
|
|
|
|
|
|
|
|
Location: `D:\automated-email-migration\logs\daily_summary\`
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
**See also:** [Troubleshooting](Troubleshooting.md), [Configuration](Configuration.md)
|
|
|
|
|