Jump to content
MakeWebGames

[FAQ] Crons Guide


Isomerizer

Recommended Posts

Quick Cron Guide

Ok, this should help you understand crons.

1. Make sure crons are uploaded on your ftp server, under "crons\are\not\4u" (You can change this on a later date).

(If there not there, Copy and paste them from your DBS folder there be under "files\crons\are\not\4u".)

2. Now lets open the mysql.php under crons and make sure the details are correct. If they are, Re-upload them onto your server.

(Now that your crons are located correctly onto your FTP server, Open up C Panel, And click "Cron Jobs" or "Crontab/s".)

3. Select "Advanced (Unix Style)". Now keeping this window open, Go back to your DBS folder, and double click crons.txt. Change all the "yourgameurl.com" to your actual domain E.G:

* * * * * curl http://amazon-survival.com/crons/are/no ... spital.php

Once you've done that you'll notice 5 *'s or 5 numbers and *'s to the left of each domain....

These indicate what goes in each box... If you dont get this part. Heres some example screenshots that should help you understand how to do this bit...

The text file should look like this..

cron1gd1.gif

And under "Cron Jobs" it should look like this...

cron2qv3.gif

If its like that, it should work.

(Dont forget to click "Commit Changes".)

FAQ's:

I cant find cron jobs or crontab's under my cpanel? "Your host does'nt support cron's"

My cron's still don't work!? "Make sure mysql.php under cron's is correct"

I don't have the cron's text file / Some cron's are missing? "You don't have a payed for version of DBS"

If theres anything else your not sure on or some information that should of been included in this guide please tell me. Thanks and i hope this helps!

Link to comment
Share on other sites

Re: Crons Guide

 

actually i think i know y its because i dont have a cron txt file

FAQ's:

I cant find cron jobs or crontab's under my cpanel? "Your host does'nt support cron's"

My cron's still don't work!? "Make sure mysql.php under cron's is correct"

I don't have the cron's text file / Some cron's are missing? "You don't have a payed for version of DBS"

:|

Link to comment
Share on other sites

  • 4 months later...

Re: Crons Guide

Hi all and this is my 2nd post so please have pitty on me! haha!

I have mccode 2.0.2, i have it stalled, just can't get the crons too work.... The manual tells you to setup your crons like this */5 * * * * curl http://offroaddrifters.com/cron_fivemins.php?code=xxx but it no worky! haha. What would I be doing wrong?

****EDIT****

Figured it out!! I needed to put my config code where the xxx is, like so!( cron_fivemins.php?code=xxx )

Didn't know and this would be the first time setting up a game...

Link to comment
Share on other sites

Re: Crons Guide

 

Hi all and this is my 2nd post so please have pitty on me! haha!

I have mccode 2.0.2, i have it stalled, just can't get the crons too work.... The manual tells you to setup your crons like this */5 * * * * curl http://offroaddrifters.com/cron_fivemins.php?code=xxx but it no worky! haha. What would I be doing wrong?

Make sure your cron codes are right.
Link to comment
Share on other sites

Re: Crons Guide

Need some help please! My Fedjail isn't updating. This is what I have in daycron. V2.0

$db->query("UPDATE fedjail set fed_days=fed_days-1");

$q=$db->query("SELECT * FROM fedjail WHERE fed_days=0");

$ids=array();

while($r=$db->fetch_row($q))

{

$ids[]=$r['fed_userid'];

}

if(count($ids) > 0)

{

My Cron is set to: 0 0 * * * curl http://offroaddrifters.com/cron_day.php ... db263a92b'

Link to comment
Share on other sites

Re: Crons Guide

This is what i use and it works fine..

 

mysql_query("UPDATE fedjail set fed_days=fed_days-1");
$q=mysql_query("SELECT * FROM fedjail WHERE fed_days=0");
$ids=array();
while($r=mysql_fetch_row($q))
{
$ids[]=$r['fed_userid'];
}
if(count($ids) > 0)
{
mysql_query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")");
}
mysql_query("DELETE FROM fedjail WHERE fed_days=0");
Link to comment
Share on other sites

  • 1 month later...

Re: [FAQ] Crons Guide

 

Is this correct??

* * * * * curl http://w w.domain.com/cron_minute.php?code=XXX

Located at /etc/crontab

yet it's not doing anything. When I go to the actual URL, it runs!!

1. Make sure you have the correct code entered for the cron job

2. Make sure you have the correct path to the cron file.

Link to comment
Share on other sites

Guest Anonymous

Re: [FAQ] Crons Guide

[me=Nyna]coughs politely[/me]

3. Make sure curl itself is on the path - better still, explicitly specify it.

4. Consider adding these jobs to a user account *not* the machine's own crontab (which runs at root privileges)

Link to comment
Share on other sites

Re: [FAQ] Crons Guide

Yes the code/URL is right. As I said, when I go to the actual URL, it runs and updates!! (That's the minute one, so the * are all correct. On the correct path to the file, it already had

01 * * * * root run-parts /etc/cron.hourly

02 23 * * * root run-parts /etc/cron.daily

22 4 * * 0 root run-parts /etc/cron.weekly

42 4 1 * * root run-parts /etc/cron.monthly

which are all empty files. So I think this file is where it goes.

For the curl stuff, would that be changing curl to some path?

Does apache or the server need to be reset when you add a cron? (I did reset them after adding them.)

Link to comment
Share on other sites

Re: [FAQ] Crons Guide

Na, cron jobs can be added without reseting the server or restarting apache.

Wish I could help more, but they always worked for me after getting the directory/file name right and after making sure the script worked correct, so I'll be looking out for an answer to this as well to file in my lil rolodex. lol

Link to comment
Share on other sites

Guest Anonymous

Re: [FAQ] Crons Guide

That's dependent on a number of factors...

The system-wide crontab requires the username, however personal crontabs don't.

Personally, I feel that running any php job as root is dangerous. It gives the script highly elevated privileges which is never a good idea.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...