在Windows中设置cron作业 [英] Setting up a cron job in Windows
问题描述
我必须每天从SFTP服务器下载一个文件。我有程序从服务器检索文件,但我正在想设置一个cron作业(或任何类似的)自动化。我们是Windows商店,需要在Windows中设置cron作业。
I have to download a file from an SFTP server everyday. I have the program which retrieves the file from the server but I was thinking of setting up a cron job (or anything similar) to automate that. We are a Windows shop and need to set up the cron job in Windows.
推荐答案
等同于cron作业的窗口是一个计划任务。
The windows equivalent to a cron job is a scheduled task.
可以按@Alex和@Rudu所述创建计划任务,但也可以使用 schtasks
(如果你需要脚本或添加到版本控制)。
A scheduled task can be created as described by @Alex and @Rudu, but it can also be done command line with schtasks
(if you for instance need to script it or add it to version control).
例如:
schtasks /create /tn calculate /tr calc /sc weekly /d MON /st 06:05 /ru "System"
创建任务计算,它每个星期一在6:05启动计算器(计算)。
Creates the task calculate, which starts the calculator(calc) every monday at 6:05 (should you ever need that.)
所有可用的命令可以在这里找到:http://technet.microsoft.com/en-us/library/cc772785%28WS.10%29 .aspx
All available commands can be found here: http://technet.microsoft.com/en-us/library/cc772785%28WS.10%29.aspx
它适用于Windows Server 2008以及Windows Server 2003。
It works on windows server 2008 as well as windows server 2003.
这篇关于在Windows中设置cron作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!