Cron syntax is used to describe when a scheduled task should run. You may see cron fields in places such as Ptero schedules, cPanel cron jobs, and other hosting control panels.

Cron fields

A cron schedule is usually split into five fields:

  1. Minute controls the minute of the hour. For example, 0 runs at the start of the hour.
  2. Hour controls the hour of the day, using 24-hour time. For example, 3 means 3 AM.
  3. Day of Month controls the day number in the month. For example, 1 means the first day of the month.
  4. Month controls which month the task runs in. For example, 1 means January.
  5. Day of Week controls which weekday the task runs on. Depending on the system, Sunday may be 0 or 7.

Common values

The * symbol means every possible value for that field. You can also use numbers, ranges, lists, and step values. A step value uses / to say how often something should repeat inside that field.

  1. * means every value.
  2. 0 means that exact value.
  3. 1,3,5 means a list of values.
  4. 1-5 means a range of values.
  5. */5 means every 5 in that field. For example, in the Minute field it means every 5 minutes. In the Hour field it means every 5 hours.

Examples

0 * * * *     Runs every hour
0 3 * * *     Runs every day at 3 AM
*/30 * * * *  Runs every 30 minutes
0 0 * * 1     Runs every Monday at midnight
0 0 1 * *     Runs on the first day of every month

If your control panel offers preset schedule options, use those unless you specifically need custom timing.

  • 0 Uživatelům pomohlo
Byla tato odpověď nápomocná?

Související články

Setting up Scheduled Tasks in TCAdmin

Log into your control panel. Enter Schedule Tasks, create a new one and choose the...

How to add sub-users in TCAdmin

Log into TCAdmin. Enter Sun Users, found under User Management. Select new, and in...

How to Increase how many players can join your Minecraft Server or Game Server

Expanding server slots is a key step in enhancing your game server's capacity, allowing more...

How to Report Abuse on Services Hosted by LogicServers

At LogicServers, we prioritize maintaining a safe and secure online environment for all our...

Feedback and Complaints Submission

We strive to provide the best service possible, we can only improve on our services with valid...