Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 19782  / 1 Year ago, fri, may 12, 2023, 4:16:41

How can I set up a php script to run via cron



I've created a file in the cron.d folder with the username as the file name:



/etc/cron.d/username


Inside of username file I placed the following cron command



0,30 * * * *   username /home/username/public_html/cron.php


I'm actually trying to get the cron working for Open Atrium however upon checking Open Atrium status it shows no signs of the cron file being run.



Any help on this would be greate


More From » cron

 Answers
5

You can use crontab to add/remove/edit cronjobs.



Hit Alt+Ctrl+T to open terminal.



First make sure the script is executable by running:



chmod +x YOURSCRIPT


Then run the following command to add your cronjob:



crontab -e


Add your cronjob like this:



0,30 * * * * /usr/local/bin/php /home/username/public_html/cron.php



That's it!



Your can check the current user's crontab entries by running:



crontab -l


For more information about crontab run:



crontab --help


OR



man crontab

[#36061] Saturday, May 13, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
errettas

Total Points: 160
Total Questions: 118
Total Answers: 91

Location: Laos
Member since Fri, Sep 11, 2020
4 Years ago
;