tate1615
asked on
How can I have a bash script create a cron job that runs every 15 minutes?
I want to have a bash script add a cron job that runs a php script every 15 minutes.
I know how to do it using:
export VISUAL=emacs
crontab -e
and then edit it manually.
But how can I automate that in a script?
Also on a sidenote this is the example crontab that the app I am trying to run reccomends:
0,15,30,45 * * * * /usr/bin/php /etc/php.ini /etc/php.d /usr/share/php \ /var/www/html/trellis/core /global/in terfaces/e vent_runne r.php
Some of these, like php.ini appear to be config files. Why would any app need config files in a cron job? Can they even be executed? That seems awfully confusing right now.
I know how to do it using:
export VISUAL=emacs
crontab -e
and then edit it manually.
But how can I automate that in a script?
Also on a sidenote this is the example crontab that the app I am trying to run reccomends:
0,15,30,45 * * * * /usr/bin/php /etc/php.ini /etc/php.d /usr/share/php \ /var/www/html/trellis/core
Some of these, like php.ini appear to be config files. Why would any app need config files in a cron job? Can they even be executed? That seems awfully confusing right now.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Also what do you make of the second half of the posted question?
Does that make any sense to you? Why would anyone's lamp web app need a crontab that runs php.ini? What do you make of it?