# ============================================================================
# TAF ERP - Crontab Configuration
# ============================================================================
# Installation: crontab -e (then paste the relevant lines)
# Or: crontab < config/crontab.conf
# ============================================================================

# TaxCore Retry Queue Processor
# Runs every 5 minutes to process failed TaxCore submissions
*/5 * * * * /usr/bin/php /var/www/html/api/cron/process_taxcore_queue.php >> /var/www/html/logs/cron_taxcore.log 2>&1

# TaxCore Queue Cleanup
# Runs daily at 2 AM to clean up old completed queue items
0 2 * * * /usr/bin/php /var/www/html/api/cron/cleanup_taxcore_queue.php >> /var/www/html/logs/cron_cleanup.log 2>&1

# ============================================================================
# Docker Installation (for php-apache container)
# ============================================================================
# 1. Copy this file to container:
#    docker cp config/crontab.conf php-apache:/etc/cron.d/taf-taxcore
#
# 2. Set permissions:
#    docker exec php-apache chmod 0644 /etc/cron.d/taf-taxcore
#
# 3. Restart cron:
#    docker exec php-apache service cron restart
#
# 4. Verify:
#    docker exec php-apache crontab -l
# ============================================================================

# Alternative: Add to existing Docker container crontab
# docker exec php-apache bash -c "echo '*/5 * * * * /usr/bin/php /var/www/html/api/cron/process_taxcore_queue.php >> /var/www/html/logs/cron_taxcore.log 2>&1' | crontab -"
