linux crontab - ghdrako/doc_snipets GitHub Wiki
- https://crontab.guru/
- https://crontab.guru/every-1-minute
- https://github.com/ghdrako/doc_snipets/wiki/linux-cron
Syntax
MIN HOUR DOM MON DOW CMD
Check Cron Daemon Status
sudo systemctl status cron
sudo systemctl status crond
Simulate cron’s environment by clearing your environment variables
env -i /bin/bash --noprofile --norc -c "/path/to/your_script.sh"
Redirect Output and Errors
*/10 * * * * /path/to/your_script.sh >> /path/to/log_$(date +'\%Y-\%m-\%d').log 2>&1 # nie dziala
*/10 * * * * /path/to/your_script.sh >> /path/to/log_$(date -I).log 2>&1 # dziala
Check the Cron Logs
/var/log/cron # redhat
tail -f /var/log/cron