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
- 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)
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
精彩评论