Cron Expression: Every Monday at 8:00 AM (0 8 * * 1)
Need to generate a cron expression?
Use CronOS to generate any cron expression you wish with natural language. Simply describe what you need, and we'll create the perfect cron expression for you. It's completely free!
Cron Expression: Every Monday at 8:00 AM (0 8 * * 1)
The cron expression 0 8 * * 1 executes a task every Monday at 8:00 AM, making it ideal for start-of-workweek operations, weekly reports, and tasks that should run when the business week begins.
Expression Breakdown
0 8 * * 1
│ │ │ │ │
│ │ │ │ └─── Day of week: 1 (Monday)
│ │ │ └───── Month: * (every month)
│ │ └─────── Day of month: * (every day)
│ └───────── Hour: 8 (at hour 8, 8:00 AM)
└─────────── Minute: 0 (at minute 0)
Field Values
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At minute 0 |
| Hour | 8 | At hour 8 (8:00 AM) |
| Day of Month | * | Every day (1-31) |
| Month | * | Every month (1-12) |
| Day of Week | 1 | Monday |
Execution Time
This expression runs once per week at:
- Monday 08:00 (8:00 AM)
Common Use Cases
1. Weekly Reports
0 8 * * 1 /usr/bin/python3 /scripts/generate-weekly-report.py
Generate and send weekly reports at the start of the workweek.
2. Weekly Data Sync
0 8 * * 1 /usr/bin/python3 /scripts/sync-weekly-data.py
Sync data from external systems or APIs at the start of the week.
3. Weekly Cache Refresh
0 8 * * 1 /usr/bin/python3 /scripts/refresh-weekly-cache.py
Refresh cached data or pre-computed values for the week ahead.
4. Weekly Notifications
0 8 * * 1 /usr/bin/node /app/send-weekly-digest.js
Send weekly digest emails or notifications to users.
Example Implementations
Weekly Report Script
# generate-weekly-report.py
import json
from datetime import datetime, timedelta
import sqlite3
def generate_weekly_report():
conn = sqlite3.connect('/var/data/app.db')
cursor = conn.cursor()
# Get data from last week
end_date = datetime.now()
start_date = end_date - timedelta(days=7)
cursor.execute('''
SELECT
COUNT(*) as total_requests,
AVG(response_time) as avg_response_time,
COUNT(DISTINCT user_id) as unique_users
FROM requests
WHERE timestamp >= ? AND timestamp < ?
''', (start_date, end_date))
metrics = cursor.fetchone()
report = {
'week_start': start_date.strftime('%Y-%m-%d'),
'week_end': end_date.strftime('%Y-%m-%d'),
'generated_at': datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
'metrics': {
'total_requests': metrics[0],
'avg_response_time': round(metrics[1], 2) if metrics[1] else 0,
'unique_users': metrics[2]
}
}
with open(f'/var/reports/weekly_{start_date.strftime("%Y%m%d")}.json', 'w') as f:
json.dump(report, f, indent=2)
print(f"{datetime.now()}: Weekly report generated")
conn.close()
if __name__ == '__main__':
generate_weekly_report()
Best Practices
- Workweek Start: Monday 8 AM aligns with typical business day start
- Error Handling: Implement comprehensive error handling and logging
- Locking: Use file locks to prevent concurrent execution
- Monitoring: Set up alerts for failed weekly jobs
- Performance: Optimize tasks to complete quickly during business hours
When to Use
✅ Good for:
- Weekly reports
- Weekly data sync
- Weekly cache refresh
- Start-of-workweek operations
- Weekly notifications
❌ Avoid for:
- Real-time critical operations
- Very long-running processes during business hours
Related Patterns
| Pattern | Expression | Description |
|---|---|---|
| Every Monday at midnight | 0 0 * * 1 | Start of week |
| Every Monday at 8 AM | 0 8 * * 1 | Start of workweek |
| Every Friday at 5 PM | 0 17 * * 5 | End of workweek |
Conclusion
The 0 8 * * 1 expression is perfect for weekly operations that should run at the start of the workweek. It's commonly used for weekly reports, data synchronization, and tasks that prepare systems for the business week ahead.
Need to generate a cron expression?
Use CronOS to generate any cron expression you wish with natural language. Simply describe what you need, and we'll create the perfect cron expression for you. It's completely free!