Cron Help

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
Tecurry95
New to forums
New to forums
Posts: 2
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Mon Sep 15, 2014 11:45 am

Cron Help

Post by Tecurry95 »

I'm having a problem with my cron. I'm not sure on how to work it and I was told to come to the forums. I'm wanting to make it so my users on my website are not online 24/7. I'm using software called Oxwall http://www.oxwall.org/. I'm wanting to set it to update instantly so when a user goes offline it shows them offline and when a user goes online it shows them online. From what I was reading this is all I have gotten out of it. I have looked at the Wiki so don't send me a link saying go here.

I put this in the Tab in my control panel called Crontab:

MAILTO="wget -q -O /dev/null http://www.thekillzone.us/ow_cron/run.php"
* * * * * /dev/null http://www.thekillzone.us/ow_cron/run.php

I know I'm not doing this right so could someone help me.

Thanks,

Trevor C.
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Cron Help

Post by soja »

This is what we use to run php scripts on our web server using cron:

* * * * * lynx -dump http://www.mysite.com/script.php

Lynx is a web browser installed on most linux systems as far as I know.

If that doesn't work, you can do this(make sure you have the exact path to your php file):

* * * * * php /home/username/public/script.php

If you don't want to get emailed the output(these scripts run every minute, prepare for spam if you leave email on), add this to the end of the line: >/dev/null 2>&1

Example:
* * * * * php /home/username/public/script.php >/dev/null 2>&1

If you need alternate times for the script to run(some of mine run every 5 minutes, others hourly, etc) you can google "crontab generator" or just ask here.
Not a NFO employee
Tecurry95
New to forums
New to forums
Posts: 2
Joined: Mon Sep 15, 2014 11:45 am

Re: Cron Help

Post by Tecurry95 »

Thanks for the help! :D Much Appreciated

Trevor C.
Post Reply