简体   繁体   English

如何安排任务仅在特定时间运行?

[英]How to schedule a task to run only at a specific time?

  1. I'm using Windows 10 Task Scheduler to run my python script daily and it runs fine.我每天使用 Windows 10 任务计划程序运行我的 python 脚本,它运行良好。 But I want that script to run only on weekdays Start time: 8.15 AM and End time: 4.15 PM.但我希望该脚本仅在工作日开始时间:上午 8.15 和结束时间:下午 4.15 运行。 So here I have configured https://imgur.com/GYuQNdl But it runs for every 8hrs, ie, 8.15, 4.15, 12.15 but I want to run it only once a day at a specific time Start time: 8.15 AM and End time: 4.15 PM.所以在这里我配置了 https://imgur.com/GYuQNdl但它每 8 小时运行一次,即 8.15、4.15、12.15 但我想每天在特定时间运行一次开始时间:上午 8.15 和结束时间: 下午 4.15。 So how can I achieve that?那么我该如何实现呢?

  2. One more thing, If I achieve a solution for the 1st ques next thing is, I don't want to run the script on public holidays or when I'm on leave.还有一件事,如果我为第一个问题找到解决方案,接下来我不想在公共假期或休假时运行脚本。 So I think that I should sync it with my calendar.所以我认为我应该将它与我的日历同步。 First of all, I wanna know is it possible to run the script in that way is there any option for that?首先,我想知道是否可以以这种方式运行脚本,有什么选择吗?

  1. You should not schedule the task to run every 8 hours if you want it to run only once a day.如果您希望任务每天只运行一次,则不应将其安排为每 8 小时运行一次。 You should only care about the start time but not the end time.您应该只关心开始时间而不是结束时间。

  2. Depends on you want to read your outlook using COM or you want to tap into Exchange server to read your calendar, you can try this to check your calendar in your script.取决于您想使用 COM 阅读您的 outlook 还是您想进入 Exchange 服务器来阅读您的日历,您可以尝试使用方法在脚本中检查您的日历。

暂无
暂无

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

相关问题 如何使用 celery 安排任务在特定时间执行? - How can I schedule a Task to execute at a specific time using celery? 如何使用Python日程安排创建作业任务,使其仅在白天从6AM到10PM的时间内每3分钟运行一次 - how to create a job task to run every 3 minutes during only at day time from 6AM to 10PM using python schedule 如何安排Celery Group在特定时间运行? - How can I schedule Celery Group to run at specific time? 如何安排代码在每天的特定时间运行? - How to schedule code to run at a specific time every day? 计划在特定时间和日期使用 pyinstaller 创建的 run.exe 文件。(不是任务计划程序) - Schedule to run .exe file created using pyinstaller at specific time and day.(not task scheduler) 如何安排脚本仅在 Windows 10 上的工作日在指定时间运行? - How to schedule a script to run at a specified time only on weekdays on Windows 10? 如何安排python脚本在特定时间每天运行? (Windows计划除外) - How can I Schedule python script to run every day at specific time ? (except Windows schedule) python在特定时间使用线程运行功能计划 - python run function schedule at specific time with thread Celery 任务计划(确保一次只执行一个任务) - Celery task schedule (Ensuring a task is only executed one at a time) Python:有没有办法安排Celery任务只在特定的时间范围内运行? - Python: Is there a way to schedule Celery tasks to run only within a specific time frame?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM