Example 14800

Crontab

System crontab with commented schedule explanations.

# System crontab
{
SHELL: "/bin/bash"
PATH: "/usr/local/bin:/usr/bin:/bin"

MAILTO: "Delilah.Effertz@yahoo.com"

jobs: {
# Full database backup at 2:00 AM daily
backup: {
schedule: "0 2 * * *"
command: """
/usr/local/bin/backup.sh --target /mnt/backup
--compress gzip
--notify Kari_Schimmel5@hotmail.com
"""
}

# Renew SSL certificates on the 1st of each month
certbot: {
schedule: "0 0 1 * *"
command: "certbot renew --quiet"
}

# Weekly log rotation and cleanup
logrotate: {
schedule: "0 0 * * 0"
command: """
/usr/sbin/logrotate /etc/logrotate.conf
find /var/log -name "*.gz" -mtime +30 -delete
"""
}
}
}

See also