开发者

How to invoke a PHP script using shell script?

I am setting a cron job on my linux server.

So i am writing a shell script for it,which invoke after every 20 minutes.

In this shell script i need to do following:

I want to executed a php script if something changed(in last 20 min) in mydata开发者_Go百科.csv file.

So plese tell me how can i do this?

-Thanks


  1. Check the last modified date on the CSV file and compare it to the current time (not on a *nix machine right now, Google it)
  2. Execute the PHP script

    /usr/bin/php /path/to/php/script.php
    

Disclaimer: The path to your PHP binary may differ

Also see http://www.linuxforums.org/forum/programming-scripting/107278-how-prgrammatically-compare-file-timestamp-against-currrent-time.html


just call php from it

php myScript.php
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜