Hourly cronjob on Windows

时光毁灭记忆、已成空白 提交于 2019-12-06 04:53:59

If you're using Windows, why not use the built-in Scheduled Tasks (Accessories-System Tools)?

It may not show up immediately in the Wizard, but it is possible to set up tasks to be run hourly. Just add a daily task and then tick the "Open Advanced Properties" checkbox. Then go to the Schedule tab and again click "Advanced".

I figured it out: 0 * * * * C:\doSomeWork.script Makes the script run every full hour. Sometimes the easy way is the best... ;) thx anyway

I'd argue you probably don't want to be using Cron on Windows at all. Instead use a Scheduled Task (accessible through the Control Panel) and select your script.

Alternatively create a Windows service which runs your program hourly. I've never heard of people using Cron for Windows tasks in this way.

Can't you use the Windows Task Scheduler instead of crontab? A commandline solution would look something like:

at 00:00 /EVERY:M,T,W,Th,F,S,Su yourScript.cmd
at 01:00 /EVERY:M,T,W,Th,F,S,Su yourScript.cmd
...

Notice that you have to schedule a new task for each hour. Anyone got a better soluition for this using the at command?

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!