简体   繁体   English

如何配置后台进程,该进程在django项目中按指定的时间间隔运行python脚本

[英]How can i configure a background process which runs a python script in my django project at specified intervals of time

I am trying to create a django web application which will scan all the network devices in a network. 我正在尝试创建一个Django Web应用程序,它将扫描网络中的所有网络设备。 As a part of this I am running my own python script to scan the network when user clicks on a scan button. 作为此过程的一部分,当用户单击扫描按钮时,我将运行自己的python脚本以扫描网络。 Now I would like to run the script in background at user specified intervals of time.In what way I can do this. 现在我想以用户指定的时间间隔在后台运行脚本。 Any help would be appreciated. 任何帮助,将不胜感激。

Thanks in advance. 提前致谢。

In simple cases use cron : 在简单的情况下,使用cron

# Run every workday at 22:00
0 22 * * 1-5 python manage.py command

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 python:子进程调用一个脚本,该脚本运行一个挂起的后台进程 - python: subprocess calling a script which runs a background process hanging 如何在 Python 中循环 function,以便我的脚本一直运行? - How can I loop the function in Python, so my script runs all the time? 如何创建在后台运行并可以干净地停止的Python脚本? - How can I create a Python script that runs in the background and can be stopped cleanly? 我如何让BASH脚本作为进程运行? 那么即使Python脚本被杀死,BASH脚本也会永远运行? - How can i let the BASH script run as process? So that even the Python script is killed the BASH script runs forever? 如何按计划在后台运行我的python脚本? - How can I run my python script in the background on a schedule? 每次运行 Python 脚本时如何创建新的 excel 文件? - How can I create a new excel file every time a Python script runs? 如何更改我的Django项目使用的Python? - How can I change the Python that my Django project is using? 我可以将我的脚本/api 添加到我的 Django 项目中吗? 如果是这样,我该怎么做 - can I add my script/apis to my Django project? If so how can I do this 如何编写 python 脚本以在指定时间自动复制文件而无需用户手动执行? - How can I write a python script to automatically copy files at a specified time without manual user execution? 如何制作启动 Python 脚本的 linux 后台进程(在 c 中) - How can I make a linux background process (in c) that launches a Python script
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM