Cron runs commands at scheduled times. A small configuration error can repeatedly execute an expensive or destructive task, so begin with a tested command and a clear purpose.
Schedule deliberately
- Ask the host which time zone cron uses and confirm the required CLI runtime.
- Use absolute paths for the interpreter, application and any files. Do not assume cron starts in the same directory as Terminal.
- Test a harmless version of the command interactively and confirm its exit code.
- Choose an interval suitable for the workload. Use application-supported locks to prevent overlapping runs.
- Keep useful error reporting, with logs outside the public root and an appropriate retention policy.
- Check the first scheduled execution and its real outcome.
Avoid repeated side effects
A job that sends mail, charges a payment or imports records must be designed to handle retries safely. Do not schedule it every minute simply because a tutorial uses that example. Stagger backups and other heavy work.
Keep secrets in protected configuration rather than the command line. Suppressing every output stream can hide persistent failures. Remove obsolete jobs after moving an application, but verify ownership and dependencies before doing so. A cron success notification does not by itself prove the intended business operation completed.
Official references
Reviewed 2026-10-22. Menus and availability depend on your hosting plan and server configuration.
