Monday, March 14, 2022

[SOLVED] Cron job vs Advanced Python Scheduler

Issue

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.


Solution

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.


Answered By - Roland Smith
Answer Checked By - Candace Johnson (WPSolving Volunteer)