Return to site

Spring CRON vs Linux CRON: NOT THE SAME ⚡⚡⚡

· devops,java,springboot

A Spring Scheduled tasks is like this:

  • 1️⃣2️⃣3️⃣4️⃣5️⃣6️⃣---------index
  • ▶️▶️▶️▶️▶️▶️------command to be executed
  • ⬆️⬆️⬆️⬆️⬆️⬆️------ Day of week (MON - SUN)
  • ⬆️⬆️⬆️⬆️⬆️-------- Month (1 - 12)
  • ⬆️⬆️⬆️⬆️----------- Day of month (1 - 31)
  • ⬆️⬆️⬆️------------- Hour (0 - 23)
  • ⬆️⬆️-------------- Minute (0 - 59)
  • ⬆️---------------- Seconds (0 - 59)

 

A Linux Cron job is like this:

  • 1️⃣2️⃣3️⃣4️⃣5️⃣---------index
  • ▶️▶️▶️▶️▶️------command to be executed
  • ⬆️⬆️⬆️⬆️⬆️-------- Day of week (0 - 7) (Sunday=0 or 7)
  • ⬆️⬆️⬆️⬆️----------- Month (1 - 12)
  • ⬆️⬆️⬆️------------- Day of month (1 - 31)
  • ⬆️⬆️--------------Hour (0 - 23)
  • ⬆️---------------- Minute (0 - 59)

Conclusion: ⚠️ careful: if spring 6 values

#spring #cron #spring6digitscron

 

All Posts
×

Almost done…

We just sent you an email. Please click the link in the email to confirm your subscription!

OK