计划任务 Linux 与 Windows

发布于 2024-10-08 02:44:22 字数 345 浏览 12 评论 0原文

我正在尝试将 crontab(Linux) 的时间参数(格式如下(* * * * *))转换为 schtasks(Windows) 的相应时间参数,这比 crontab 的时间参数要复杂一些。

我正在编写一个应用程序来执行此操作,并且它变得越来越复杂,因为 crontab 有很多提供时间参数的可能性/排列。

我想知道这是否是编写用于转换参数的程序的正确方法,或者是否存在更好的方法来实现此目的?

由于 crontab 中的参数可以通过多种可能的方式提供,例如 (0 0 1,10,15 * *) 会将任务安排在 1 日、10 日和 1 日午夜。本月 15 日。那么,schtasks 是否有可能采用可以执行相同类型调度的参数?

I'm trying to convert the time parameter of crontab(Linux) which is formatted like this(* * * * *) to the corresponding time parameter of schtasks(Windows) which is kind of complex then that of crontab.

I'm in the middle of writing an application for doing this and its kinda getting more and more complex since crontab have so many possibilities/permutations for providing the time parameter.

I was wondering if this is the right approach to write a program for converting the parameter, or there exist any better approach for achieving this?

And since parameters in crontab can be provided in many possible ways like (0 0 1,10,15 * *) would schedule the task for midnight on 1st ,10th & 15th of month. So, is it possible at all for schtasks to take parameters that can do the same kind of scheduling?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

滴情不沾 2024-10-15 02:44:22

您检查过 Windows 的这些 cron 端口吗?

Have you checked these cron ports to Windows?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文