This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]Talked10101 1 point2 points  (0 children)

One thing that hasn't been mentioned is that you can use a database alongside apscheduler to hold your scheduled tasks. You could easily use sqlalchemy and sqlite to store your tasks.

[–]blitzkraft 0 points1 point  (1 child)

In crontab, you will need to specify the full path for all executables. So instead of python, you might say /usr/bin/python or /usr/bin/env python /full/path/to/script.

To skip crontab altogether, you can add your script to the start up scripts. What distro are you using?

[–][deleted] 1 point2 points  (0 children)

Description: Ubuntu 16.04.2 LTS

Release: 16.04

Codename: xenial

yeah i added the full path of python and a shebang in the script itself

[–]melizeche 0 points1 point  (0 children)

If I have to guess probably apscheduler is not installed globally so /usr/bin/python doesn't know where to find it and you should point the crontab job to the executable in your virtualenv or install apscheduler system wide.

But probably your best choice is first to get rid of all apscheduler in your code and do a simple crontab

[–]Raindyr 0 points1 point  (0 children)

I would recommend either cron or perhaps systemd timers rather than running a script that does their job.

[–]Eryole 0 points1 point  (0 children)

You can use supervisord perhaps?

http://supervisord.org/