Check Cron Service Status
sudo systemctl status cron # Debian/Ubuntu
sudo systemctl status crond # CentOS/RHEL
# Start/enable if needed
sudo systemctl enable cron --now
Check Cron Logs
sudo tail -f /var/log/syslog | grep CRON
sudo tail -f /var/log/cron
journalctl -u cron -f
Verify User's Crontab
# For specific user
sudo crontab -u username -l
# For root
sudo crontab -l
# Your user
crontab -l
Common Format Errors
# Wrong: missing fields
* * * * command
# Correct: 5 fields then command
* * * * * /usr/bin/php /path/to/script.php
Check Command Path
Always use absolute paths:
# Wrong
php script.php
# Correct
/usr/bin/php /var/www/script.php
# Find command path
which php
Test Command Manually
# Run as the cron user
sudo -u username /usr/bin/php /path/to/script.php
Check Cron Allowed Users
# User in cron.deny? Check these files
cat /etc/cron.allow
cat /etc/cron.deny
# If cron.allow exists, user must be listed
Redirect Output to Log
* * * * * /path/to/script >> /var/log/mycron.log 2>&1
Check Script Permissions
chmod +x /path/to/script.sh