L
L
loonywizard2016-07-04 20:23:17
Django
loonywizard, 2016-07-04 20:23:17

How to make Django run a Python script every N minutes?

Good afternoon
, I have a Django project, a Python script that, regardless of Django, deletes files that, say, 5 minutes have passed since they were created; and I need to somehow run this script every N minutes in order to clear the server of old files.
actually the question is:
can I run this script directly from Django?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
sim3x, 2016-07-04
@sim3x

Directly from django django commands
To run cron at intervals
To delete files older than x-days, neither django nor python is needed

V
Vladimir, 2016-07-04
@vintello

add Celery to your Django project and forget about background task headaches forever

V
Vadim K, 2016-07-05
@OLQLOSH

#crontab -e
*/5 * * * * find /path -type f -exec rm -f {} +

A
Alexey Sergeev, 2016-07-07
@SergeevAI

I am using django-crontab .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question