Utvikling · verktøy

Cron-uttrykksbygger

Velg en enkel plan og se det tilhørende cron-uttrykket.

Kjøres i nettleseren. Ingen opplasting.

Values are processed locally in this browser.

Result

—

Om verktøyet

Cron-uttrykksbygger sem complicação.

Byggeren støtter vanlige mønstre for minutt, time, dag i måneden, måned og ukedag. Den tolker ikke Quartz-utvidelser og beregner ikke neste kjøring justert for tidssone.

Veiledning

Slik bruker du Cron-uttrykksbygger

The Cron Expression Builder turns a simple schedule into a five-field cron line. You pick every hour, day, week or month, then type the minute, hour, weekday and day of the month that apply. The line is ready to copy into a scheduler. It does not explain the line in words, list the next run times, or convert time zones, and it cannot write ranges, lists or step values such as */5.

Slik gjør du

  1. Pick Every hour, Every day, Every week or Every month from the Schedule list.
  2. Type a whole number in all four boxes: minute (0 to 59), hour (0 to 23), weekday (0 to 6) and day (1 to 31). The boxes your choice does not use are ignored, but they must still hold a valid number.
  3. Press Calculate. The cron line appears in the Result box, and Copy result puts it on your clipboard.
  4. Press Clear to empty every box. The boxes start blank after that, so fill in all four numbers again before you press Calculate.

Eksempler

Every hour at minute 30

Du skriver inn
Tidsplan
Every hour
Minutt
30
Time
9
Ukedag
1
Dag i måneden
1
Du får
Cron-linje
30 * * * *

Only the minute is used. The hour, weekday and day boxes still need valid numbers, but they do not change the line.

Kjørt med verktøyets egen kode.

Every Friday at 18:15

Du skriver inn
Tidsplan
Every week
Minutt
15
Time
18
Ukedag
5
Dag i måneden
1
Du får
Cron-linje
15 18 * * 5

Weekday numbers run from 0 to 6, with 0 meaning Sunday, so 5 is Friday. The day-of-month field stays as a star.

Kjørt med verktøyets egen kode.

The 31st of the month at 03:00

Du skriver inn
Tidsplan
Every month
Minutt
0
Time
3
Ukedag
1
Dag i måneden
31
Du får
Cron-linje
0 3 31 * *

The month field is always a star, so the line is meant for every month. A month with fewer than 31 days has no 31st, so a standard cron has nothing to match there. Check how your scheduler treats this.

Kjørt med verktøyets egen kode.

A minute that is out of range

Du skriver inn
Tidsplan
Every day
Minutt
60
Time
9
Ukedag
1
Dag i måneden
1
Du får
Melding
Check the allowed ranges for minute, hour, weekday and day.

Minute 60 does not exist. Any of the four boxes outside its range, or not a whole number, gives this same message and no line.

Kjørt med verktøyets egen kode.

Når det er nyttig

  • Write the schedule line for a nightly backup or cleanup job on a server.
  • Draft a weekly report job that runs on one chosen weekday and time.
  • Set up a monthly task, such as a billing run, on a fixed day of the month.
  • Check a hand-written line against a simple case while you are learning the five fields.

Begrensninger

  • It writes only the five standard fields: minute, hour, day of month, month and day of week. There is no seconds field, no year field and no special symbols from other schedulers.
  • Each box takes one whole number. It cannot write ranges (1-5), lists (1,15) or steps (*/10), and the month field is always a star.
  • It does not read a line back, explain it in plain words, or show when it will next run. It also adds no time zone, so the zone is whatever your scheduler uses.
  • Weekday accepts 0 to 6 only. Some cron programs also accept 7 for Sunday, but this builder rejects 7.

Tips

  • Add a comment next to the line in your crontab naming the time zone and what the job does.
  • Avoid days 29, 30 and 31 for jobs that must run every month.
  • Try the new line with a harmless command first, and read your scheduler's own documentation for anything this builder cannot write.

Kilder

Vanlige spørsmål

Sobre Cron-uttrykksbygger.

Which cron syntax does this builder use?

It writes the classic five-field form: minute, hour, day of month, month and day of week, separated by spaces. The month field is always a star here. The result is a line such as 15 18 * * 5, without any command after it.

Will every scheduler read the line the same way?

Not always. The classic crontab uses five fields, but some schedulers add a seconds field, a year, or extra symbols, and they may number weekdays differently. Cloud and application schedulers each have their own rules, so read the documentation of the one you use.

Which number is Sunday?

In the POSIX crontab description the day of week runs from 0 to 6 with 0 as Sunday, and this builder follows that. The Linux crontab manual also lets 7 mean Sunday, but this builder does not accept 7.

What time zone will the job run in?

The cron line holds no time zone. The job runs in whatever zone the scheduler or server is set to, and this tool never asks for one or converts times. If your server uses UTC, work out the hour in UTC before you type it.

Can I build an every-15-minutes schedule?

Not with this builder, because each box takes a single number. Many cron programs accept step values such as */15 in the minute field, so you could type that by hand, but check that your scheduler supports it.

What happens when both day of month and weekday are set?

This builder never sets both. The weekly choice leaves the day of month as a star, and the monthly choice leaves the weekday as a star. In the POSIX description, if both fields hold values, a day matching either one is run.

Does the tool send my schedule anywhere?

No. The line is built by code running in your browser tab. Nothing you type is uploaded. Your command and server details never appear in this tool, because it only writes the five time fields.

Hvordan bruker du Cron-uttrykksbygger?

Velg en enkel plan og se det tilhørende cron-uttrykket.

Lastes dataene mine opp til en server?

Nei. Behandlingen skjer i nettleseren din, og opplysningene dine lastes ikke opp.