1

I am testing an application in MAMP and would like to add a cron job, or as I am on a mac the job through is run through launchctl. My cron is a php file that runs a database query. Naturally the php file and mysql db are in separate directories. Where should I change my working directory to such that the cron will query the database? FYI, I have a standard installation /Applications/MAMP/...

Many thanks.

4

1 回答 1

0

我上面的错误是我试图指向数据库的目录,而 php 文件已经为我处理了。运行程序就像运行以下代码一样简单:

php -q /path/to/my/doc.php

我发现通过一个名为lingonlaunchtl的 5-10 美元的程序来管理是最容易的。如果您正在考虑一次管理多个 cron,强烈推荐。否则,如果您想坚持使用命令行,是一个很好的教程。

于 2013-10-05T19:34:49.693 回答