What it is
The server's built-in alarm clock: run a backup at night, check slots every five minutes, clean old files weekly. Works with no human involved.
How we use it
Database and site backups, monitoring, bot broadcasts. Container time is always set to the client's timezone so "3 a.m." means 3 a.m. locally.
Where it helps a business
- A backup should be made every night without a person involved.
- Old logs and files should be cleaned up by themselves before they fill the disk.
- The server should regularly check itself and neighbouring services.
How we use it
On the websites server cron and logrotate handle log rotation and nightly snapshots of mail and site data; the same server runs a watchdog for the VPN chain and a job that pulls a copy of the VPN database. Certificates renew on a certbot timer. Jobs tied to a bot's data (reminders, escalations, reports) live in a scheduler inside the bot itself.
Common problems
- A job silently fails. Cron does not report errors by itself; a failed backup should send a message.
- "3 a.m." in someone else's time. The time on the server and in containers is set to Moscow time, so "3 a.m." means 3 a.m. in Moscow.
When you do not need it
If a job depends on a bot's data, such as reminding a customer or escalating a ticket, a scheduler inside the bot is more convenient than cron.