- Using
cron
Seems to add another entry point into your application, whileQuartz
Wocould integrate into it. So you wocould be forced to deal with some inter-process communication if you wanted to pass some information to/from the process invoked fromcron
. InQuartz
You simply (hehe) run multiple threads. cron is the process level, and quartz is the thread level. If there is dependency and communication relationship between tasks, cron is a big problem, while quartz only needs to consider how to schedule threads.
cron
Is platform dependent,Quartz
Is not. cron depends on the UNIX platform, while quartz enables cross-platform
Quartz
May allow you to reliably make sure a task is run at the given time or some time after if the server was down for some time. Purecron
Wouldn't do it for you (unless you handle it manually). Quartz will ensure that the task will be re-executed at the specified time even if the service is restarted, while cron will not
Quartz
Has a more flexible language of expressing occurences (when the tasks shocould be fired). quarz supports more abundant execution commands
- Consider the memory footprint. if your single tasks share nothing or little, then it might be better to run them from the operating system as a separate process. if they share a lot of information, it's better to have them as threads within one process. quartz occupies less memory and executes multiple tasks in a single process, while cron is a separate process.
- Not quite sure how you cocould handle the clustering in
cron
Approach.Quartz
Might be used with terracotta following the scaling out pattern (I haven't tried it, but I believe it's doable ).
- In addition, quartz supports tasks in seconds, while cron supports tasks in minutes. quratz provides a visual task management interface, which improves monitoring, O & M, and robustness.
- Quartz Clusters
Original article: Workshop
Timer UNIX crontab vs quartz