# ========================================
# cPanel Cron Jobs for ELMIS Backup System
# ========================================

# IMPORTANT: Replace 'yourusername' with your actual cPanel username
# IMPORTANT: Replace '/usr/local/bin/php' with your server's PHP path

# ========================================
# 1. DAILY DATABASE BACKUP (12:00 AM) - LOW MEMORY VERSION
# ========================================
# Minute: 0
# Hour: 0  
# Day: *
# Month: *
# Weekday: *
# Command (LOW MEMORY):
/usr/local/bin/php /home/yourusername/public_html/artisan backup:database-lowmem --notify --cleanup >> /home/yourusername/logs/backup.log 2>&1

# ========================================
# 2. WEEKLY FULL BACKUP (Sunday 2:00 AM)
# ========================================  
# Minute: 0
# Hour: 2
# Day: *
# Month: *
# Weekday: 0
# Command:
/usr/local/bin/php /home/yourusername/public_html/artisan backup:run >> /home/yourusername/logs/full-backup.log 2>&1

# ========================================
# 3. DAILY HEALTH CHECK (3:00 AM)
# ========================================
# Minute: 0
# Hour: 3
# Day: *
# Month: *
# Weekday: *
# Command:
/usr/local/bin/php /home/yourusername/public_html/artisan backup:monitor >> /home/yourusername/logs/health.log 2>&1

# ========================================
# 4. WEEKLY CLEANUP (Sunday 4:00 AM)
# ========================================
# Minute: 0
# Hour: 4
# Day: *
# Month: *
# Weekday: 0
# Command:
/usr/local/bin/php /home/yourusername/public_html/artisan backup:clean >> /home/yourusername/logs/cleanup.log 2>&1

# ========================================
# How to Add in cPanel:
# ========================================
# 1. Login to cPanel
# 2. Find "Cron Jobs" in Advanced section
# 3. Click "Cron Jobs"
# 4. For each job above:
#    - Set the time values (Minute, Hour, Day, Month, Weekday)
#    - Copy the command into the "Command" field
#    - Click "Add New Cron Job"

# ========================================
# Alternative: Standard Cron Format
# ========================================
# Copy these lines if your cPanel supports standard cron format:

# Daily backup at midnight (LOW MEMORY)
0 0 * * * /usr/local/bin/php /home/yourusername/public_html/artisan backup:database-lowmem --notify --cleanup >> /home/yourusername/logs/backup.log 2>&1

# Weekly full backup (Sunday 2 AM)  
0 2 * * 0 /usr/local/bin/php /home/yourusername/public_html/artisan backup:run >> /home/yourusername/logs/full-backup.log 2>&1

# Daily health check (3 AM)
0 3 * * * /usr/local/bin/php /home/yourusername/public_html/artisan backup:monitor >> /home/yourusername/logs/health.log 2>&1

# Weekly cleanup (Sunday 4 AM)
0 4 * * 0 /usr/local/bin/php /home/yourusername/public_html/artisan backup:clean >> /home/yourusername/logs/cleanup.log 2>&1
