Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cron job vs Advanced Python Scheduler

Tags:

python

cron

If you want to run your python script, let's say every day at 6 pm, is it better to go with a crontab entry or with a Advanced Python Scheduler solution regarding to power, memory, cpu ... consumption?

In my eyes doing a crone job is therefore better, because I do not see the advantage of permanently running an Advanced Python Scheduler.

like image 875
N8_Coder Avatar asked Apr 16 '16 09:04

N8_Coder


2 Answers

You should probably use cron if two conditions are met;

  1. It is available on all platforms your code needs to run on.
  2. Starting a script on a set time is sufficient for your needs.

Mirroring these are two reasons to build your own solution:

  1. Your program needs to be portable across many operating systems, including those that don't have cron available. (like ms-windows)
  2. You need to schedule things in a way other than on a set start time. E.g. on a set interval, or if some other condition it met.
like image 158
Roland Smith Avatar answered Sep 28 '22 09:09

Roland Smith


Agreed cron is better from resources point of view. From functional point of view cronjob is better if your requirement is to just run a script at a specific time or schedule it on regular intervals. But if your requirement is more complicated you should check out Advance Python Schedular.

Hope it helps.

like image 31
Jimmy Avatar answered Sep 28 '22 08:09

Jimmy