首页 > 解决方案 > Cron 作业如何工作?

问题描述

从最近几天开始,我一直在寻找一种在特定时间重新启动脚本的方法。那是我被介绍给 Cron Job 的时候。我是通过一个链接来的

https://marketplace.visualstudio.com/items?itemName=mkloubert.vs-cron#jobs-

其中说明了如何在 settings.json 文件中使用使用 cron 作业。我已经在 Visual Studio 中下载了扩展名,并使用命令指定了文件的位置。我做了一个代码: -


{
    
    "python.pythonPath": "/usr/bin/python3",
    "python.linting.pylintEnabled": true,
    "python.linting.enabled": true,
    
    
        "cron.jobs": {
            "jobs": [
                {
                   
                    "name": "Rebooting the software",
                    "description": "Rebooting the software three times in a day.",
                    
                    "time": "0,0,17 0,12,10 * * * * *",
                    "action": {
                        "type": "command",
                        "command": "/home/pi/Schreibtisch/PSTecSoftware/AccessControlRepository/AccessControl/DevicesWrapper.py.extension.cronJons.restartRunningJobs"
                        
                    }
                    

                    }
            ]
            }
    
    

}

它不工作我真的不知道我应该做些什么改变才能让它工作。

标签: pythonvisual-studiocron

解决方案


推荐阅读