Server Tools: Cron Jobs
Cron jobs with Server Tools: create, list and remove files in /etc/cron.d, naming rules, allowed schedules and commands, and why cron remove has to be used with care.
Cron Jobs
Server Tools manages system-wide cron jobs as individual files in /etc/cron.d/. Every job runs as root.
Add a job
server-tools cron add --schedule '0 3 * * *' --command '/usr/local/bin/cleanup.sh' --name 'nightly-cleanup'
All three options are required. The tool writes the file /etc/cron.d/<name> with mode 644:
# Cron Job - Created 2026-01-15 03:00:00 by server-tools
0 3 * * * root /usr/local/bin/cleanup.sh
Name
The name is converted to lowercase, every character except a-z, 0-9, _ and - becomes _. Nightly Cleanup becomes nightly_cleanup. If the file exists, the tool asks Overwrite existing cron job?. With --yes it is overwritten without a prompt.
Schedule
Five fields that consist only of digits and the characters *, /, , and -, for example */15 * * * * or 0 4 * * 1-5. Names such as mon or jan and shortcuts such as @daily are rejected.
Command
At most 500 characters, printable characters only, no line break.
List
server-tools cron list
Shows every file in /etc/cron.d with its content and then the root crontab (crontab -l). All files are shown, not only those created by Server Tools.
As a CLI command,
cron listcurrently prints only the first file and then exits with code 1. In the menu ("List cron jobs") the output runs through completely. On the shell, show the files withcat /etc/cron.d/*.
Remove
server-tools cron remove --pattern nightly-cleanup
The tool searches all files in /etc/cron.d/ for the search text (as a fixed string, not a regular expression). For every match it shows the content and asks Delete this cron job?. The whole file is deleted. If there is no match, the command ends with exit code 1.
The search is not limited to files of Server Tools. Cron files of other packages are also found if they contain the text. With
--yesall matches are deleted without a prompt. Choose a pattern that only matches your job and check it withcron listfirst.
Example: daily database backup
server-tools cron add \
--schedule '0 2 * * *' \
--command '/usr/local/bin/server-tools --yes db backup --name shop_db' \
--name 'db-backup-shop'
For cron jobs use db backup per database. For db backup-all note the limitation on the Databases page.