[英]How to schedule a task to run only at a specific time?
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?
那么我该如何实现呢?
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?
首先,我想知道是否可以以这种方式运行脚本,有什么选择吗?
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.
您应该只关心开始时间而不是结束时间。
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.