This cron expression will run at 12:00 AM (midnight) every day.
Field | Allowed Values | Special Characters |
---|---|---|
Minute | 0-59 | * , - / |
Hour | 0-23 | * , - / |
Day of Month | 1-31 | * , - / |
Month | 1-12 | * , - / |
Day of Week | 0-6 (0=Sunday) | * , - / |
Special Characters:
Use */5 * * * *
. The */5
in the minute field means "every 5 minutes". This will execute at 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, and 55 minutes past every hour.
Use 0 2 * * *
. This runs at exactly 2:00 AM every day. The first 0
sets the minute to 0, the 2
sets the hour to 2 AM, and the three *
symbols mean every day, every month, and every day of the week.
Use 0 9 * * 1-5
(for 9 AM on weekdays). The 1-5
represents Monday through Friday. Sunday is 0, Monday is 1, Tuesday is 2, etc. You can change the hour and minute as needed.
Use 0 9 * * 1
for every Monday at 9:00 AM. The 1
in the last field represents Monday. Change the hour (9) and minute (0) to your preferred time.
Use */15 * * * *
. This executes at 0, 15, 30, and 45 minutes past every hour, every day.
Use 0 0 * * *
. The first 0
is minute 0, the second 0
is hour 0 (midnight), and the three *
mean every day, every month, and every day of the week.
This means "every minute of every hour of every day" - essentially running every single minute. Be careful with this as it can overwhelm your system.
Use 0 * * * *
. This runs at the top of every hour (1:00, 2:00, 3:00, etc.) every day.
To add a cronjob in ServerAvatar: 1) Login to your ServerAvatar dashboard, 2) Select your server, 3) Navigate to the 'Cronjobs' section, 4) Click 'Create Cronjob', 5) Enter your cron expression and command, 6) Save the cronjob. For detailed step-by-step instructions, visit the complete guide at https://serveravatar.com/docs/server/create-a-cronjob