如何在Windows上运行crontab在Cygwin? [英] How do you run a crontab in Cygwin on Windows?

查看:170
本文介绍了如何在Windows上运行crontab在Cygwin?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些cygwin命令是 .exe 文件,所以你可以运行它们与标准的Windows调度程序,但其他人没有 .exe 扩展,所以不能从DOS(看起来像)运行。

Some cygwin commands are .exe files, so you can run them with the standard Windows Scheduler, but others don't have an .exe extension so can't be run from DOS (it seems like).

例如,我希望 updatedb 每晚运行。

For example I want updatedb to run nightly.

如何使cron工作?

推荐答案

您还需要安装 cygrunsrv ,因此您可以将cron设置为Windows服务,然后运行 cron-config

You need to also install cygrunsrv so you can set cron up as a windows service, then run cron-config.

希望cron作业发送任何输出的电子邮件,您还需要安装 exim ssmtp cron-config 。)

If you want the cron jobs to send email of any output you'll also need to install either exim or ssmtp (before running cron-config.)

请参阅 / usr / share / doc / Cygwin / cron - *。README 了解更多详情。

对于没有 .exe ,它们可能是某种类型的shell脚本。如果你看看文件的第一行,你可以看到你需要使用什么程序来运行它们(例如,#!/ bin / sh )可能可以通过调用shell程序(例如 C:\cygwin\bin\sh.exe -l / my / cygwin / path / to / prog 。)

Regarding programs without a .exe extension, they are probably shell scripts of some type. If you look at the first line of the file you could see what program you need to use to run them (e.g., "#!/bin/sh"), so you could perhaps execute them from the windows scheduler by calling the shell program (e.g., "C:\cygwin\bin\sh.exe -l /my/cygwin/path/to/prog".)

这篇关于如何在Windows上运行crontab在Cygwin?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆