🔧
:
💻
Tips: Use full paths for commands and scripts for reliability
📚
{{ example.expression }}
{{ example.description }}
{{ example.use_case }}
📤
{{ cronLine }}
📖
{{ explanation.summary }}
Minute: {{ explanation.minute }}
Hour: {{ explanation.hour }}
Day: {{ explanation.dayOfMonth }}
Month: {{ explanation.month }}
Weekday: {{ explanation.dayOfWeek }}
💡
1. Edit crontab:
crontab -e
2. Add your cron job:
{{ cronLine }}
3. Save and exit
Other commands:
crontab -l- List current cron jobscrontab -r- Remove all cron jobscrontab -u username -e- Edit another user's crontab
⚠️ {{ error }}
ℹ️ About Cron Job Generator
Cron schedules commands on Unix and Linux systems by matching the current minute against rows in a crontab file. A user crontab normally has five time fields followed by the command; system crontabs such as /etc/crontab and files in /etc/cron.d add a username field before the command. The classic format is documented by
crontab(5), and the daemon behavior is described in
cron(8).
Cron expression format:
# minute hour day-of-month month day-of-week command # 0-59 0-23 1-31 1-12 0-7 * * * * * /path/to/command
Supported field values:
*matches every value in that field, such as every minute or every month.,lists values, for example1,15for the 1st and 15th day of the month.-creates an inclusive range, for example1-5for Monday through Friday in the day-of-week field./applies a step within the field range, for example*/15in the minute field for minutes 0, 15, 30, and 45.- Month and weekday names are accepted by common Vixie/Cronie-style implementations, such as
JAN,MON, orMON-FRI.
Examples:
0 2 * * * /usr/local/sbin/backup.shruns a backup every day at 02:00.*/15 * * * * /usr/bin/curl -fsS https://example.com/healthruns a health check four times per hour.30 4 1,15 * 5 /usr/local/bin/reportruns at 04:30 on the 1st and 15th of each month and also on Fridays on common cron implementations.
Common use cases:
- Automated backups, cleanup jobs, cache warmers, and database maintenance windows.
- Report generation, notification batches, file transfers, and data synchronization.
- Periodic health checks for internal services when a full monitoring system is not required.
- Developer and operations scripts that need simple host-local scheduling without another queue service.
Reliability and safety notes:
- Use absolute paths for commands and scripts because cron runs with a small environment. Set
SHELL,PATH,MAILTO, orCRON_TZexplicitly when a job depends on them. - Cron has one-minute granularity in the classic five-field format. It does not support seconds unless your scheduler uses a nonstandard extension.
- Step values are evaluated inside one field. For example,
*/35in the minute field runs at minute 0 and 35 of each hour, not every 35 elapsed minutes. - When both day-of-month and day-of-week are restricted, many Linux cron implementations run the command when either field matches. Test complex schedules before installing them.
- Daylight-saving time can skip or repeat matching wall-clock times. For catch-up behavior after downtime, dependency ordering, randomized delay, or sleep/wake handling, consider a systemd timer instead of a plain crontab entry.
- Avoid placing secrets directly in cron command lines. Put credentials in protected files or service-specific environment files and redirect output to logs you can rotate and monitor.
API Usage Example:
POST /api/tools/linux/cron
Content-Type: application/json
{
"minute": "0",
"hour": "2",
"dayOfMonth": "*",
"month": "*",
"dayOfWeek": "*",
"command": "/usr/bin/backup.sh",
"generateExamples": true
}