Hi. I'm trying to get a script to run every hour, but it's not being triggered. Here's all the relevant code in my start.php. Do I need anything else in here to get my finishChallenges function to work?
elgg_register_event_handler('init', 'system', 'profile_tweak_init');function profile_tweak_init() {
//miscallaneous code
register_plugin_hook('cron', 'hourly', 'finishChallenges');}
function finishChallenges($hook, $entity_type, $returnvalue, $params) {
//miscellaneous code
}
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ihayredinov@ihayredinov

ihayredinov - 0 likes
- ameetnsharma@ameetnsharma

ameetnsharma - 0 likes
- ihayredinov@ihayredinov

ihayredinov - 0 likes
- Thuvalpakshi@thuvalpakshi

Thuvalpakshi - 0 likes
- Virlli@virllinia

Virlli - 0 likes
- Florian DANIEL aka Facyla@Facyla

Florian DANIEL aka Facyla - 0 likes
You must log in to post replies.Did you configure crontab on your server?
http://docs.elgg.org/wiki/Cron
Hi Ismayil. I hadn't, but I did so after reading your post.
I tried doing crontab -e with this file:
# Location of GET
GET='/usr/bin/GET'
# Location of your site (don't forget the trailing slash!)
ELGG='http://www.example.com/'
# The crontab
@reboot $GET ${ELGG}cron/reboot/
* * * * * $GET ${ELGG}cron/minute/
*/5 * * * * $GET ${ELGG}cron/fiveminute/
0 * * * * $GET ${ELGG}cron/hourly/
0 0 * * * $GET ${ELGG}cron/daily/
0 0 * * Sat $GET ${ELGG}cron/weekly/
0 0 1 * * $GET ${ELGG}cron/monthly/
0 0 1 1 * $GET ${ELGG}cron/yearly/
But it's still not working.
I assume you have changed the location of your site. Do a google search, there are plenty of resources out there. If 'get' doesn't work, try wget or curl. I tend to use curl
you need to do that in Cpanel of your hosting account.. just need to enter
curl http://your_site.com/cron/daily like that
its as simple as that
I have the same problem. Is really necesary to configure crontab on my server?. For example Garbage collector work with plugin hook and it isn't necessary to use crontab on server. No? I try a lot of options whitout results.
Some servers don't support the @... shortcut, so just remove the @reboot and any remaining @ and this should work as expected :