View Full Version : Cron Jobs
shwaza
01-28-2005, 10:03 AM
Hi, this is probably in the wrong forum, but i couldn't think of a better one lol.
Anyway, i'm creating a game on my own server (at least until it gets good, i might move it to hm, but i might kill my bw and everything :P) And i'm trying to make "turns". You probably all know what i mean, if you have ever played any text based games. Anyway, i know that this is possible with cron jobs, but i don't have that on my server. Is cron jobs available to download? Or is there an equivilant to it that i can use? Because i need something to update each row of my table every period of time to add a turn to each player.
If anyone knows anything about this please help :P
Smoky
01-28-2005, 02:26 PM
Originally posted by shwaza@Jan 28 2005, 11:03 AM
Hi, this is probably in the wrong forum, but i couldn't think of a better one lol.
Anyway, i'm creating a game on my own server (at least until it gets good, i might move it to hm, but i might kill my bw and everything :P) And i'm trying to make "turns". You probably all know what i mean, if you have ever played any text based games. Anyway, i know that this is possible with cron jobs, but i don't have that on my server. Is cron jobs available to download? Or is there an equivilant to it that i can use? Because i need something to update each row of my table every period of time to add a turn to each player.
If anyone knows anything about this please help :P
25221
Cron jobs isnt a piece of software you use its something embedded into Apache or something around that area.
If you wanted to do a game based on ticks then cron jobs is the most important thing you need.
If you go into your CPanel theres a opition called Cron jobs. Go check it out.
I have used them once but couldnt get them fully to work. I cant remeber the syntax but go into the PHP forms i think i posted something there.
shwaza
01-28-2005, 03:12 PM
Well, i'm not using hm right now, it's still on my server. But i think i might need to move it because cpanel is really handy :P Anyway, i'd rather not move it if i had to, because there are quite a few files and mostly the sql data, but if anyone knows if it's possible to set it up...
688206002
01-28-2005, 04:17 PM
Which OS are you running?
If you're on Windows, it's prolly better to use the Task Scheduler.
A lil more info plz Liam :)
shwaza
01-28-2005, 04:30 PM
sorry, yeah it's windows. What's task scheduler? Is it free? And also, i have a question about cron jobs. Would you tell it to go to a certain directory, and there would be say, a query there, and every hour, the thing would go to that file, and run the query? Also, how would you tell it which query to run? Or would you just make a file with only one bit of thing on it.
EDIT: lol, this is post 911
EDIT: nvm i found it, it's in control panel :P, does anyone know how to use it though? lol
688206002
01-28-2005, 05:12 PM
Originally posted by shwaza@Jan 28 2005, 11:30 AM
sorry, yeah it's windows. What's task scheduler? Is it free? And also, i have a question about cron jobs. Would you tell it to go to a certain directory, and there would be say, a query there, and every hour, the thing would go to that file, and run the query? Also, how would you tell it which query to run? Or would you* just make a file with only one bit of thing on it.
EDIT: lol, this is post 911
EDIT: nvm i found it, it's in control panel :P, does anyone know how to use it though? lol
25243
Well, this is how mine looks (cron, not Task Scheduler)
php -f /home/polaris/public_html/soe/includes/cron.php
obviously, replace polaris with your cpanel username, and change the file path
in cron.php, you can tell it to do things to the DB (ie. remove a "turn," add money to player accts, etc)
Task Scheduler has come with every Windows OS since like Win98... :P
If you wanna find it, it's: Control Panel => Schedule Tasks
shwaza
01-28-2005, 05:15 PM
Oh ok, well do you know how to do that same sort of thing with task manager? Because i have made a file, (turn.php) and it has a query to update the table accounts, to count the field turns +1, each time that the page is viewed. I want task manager to go to that page every hour or something, and then the page will do it's stuff :P
688206002
01-28-2005, 05:22 PM
Originally posted by shwaza@Jan 28 2005, 12:15 PM
Oh ok, well do you know how to do that same sort of thing with task manager? Because i have made a file, (turn.php) and it has a query to update the table accounts, to count the field turns +1, each time that the page is viewed. I want task manager to go to that page every hour or something, and then the page will do it's stuff :P
25250
http://www.ubbcentral.com/resources/Advanced_Cron.html
This shows you how to set it up and get Apache to execute the file instead of opening in a PHP editor.
shwaza
01-28-2005, 05:43 PM
well, interestingly enough, i don't know the password for my computer LOL, is there anyway that i can find that out? Lol, anyway, down at the bottom it says
Originally posted by That page you gave me the link to
The key to this is that PHP must be be compiled correctly on the server and .php extensions need to be handed off to PHP correctly via the registry if you are running IIS.
Will it automatically use my php, or will i have dreamweaver opening ever hour LOL.
688206002
01-28-2005, 06:24 PM
Originally posted by shwaza+Jan 28 2005, 12:43 PM--><div class='quotetop'>QUOTE(shwaza @ Jan 28 2005, 12:43 PM)</div><div class='quotemain'>well, interestingly enough, i don't know the password for my computer LOL, is there anyway that i can find that out? Lol, anyway, down at the bottom it says
<!--QuoteBegin-That page you gave me the link to
The key to this is that PHP must be be compiled correctly on the server and .php extensions need to be handed off to PHP correctly via the registry if you are running IIS.
Will it automatically use my php, or will i have dreamweaver opening ever hour LOL.
25253
[/b][/quote]
Well, is PHP compiled directly on your server? (How did you install apache, php, and mysql?)
Dunno how to find your comp password for you... sorry... lol... if I could, then I'd be cracking things now :)
shwaza
01-28-2005, 06:54 PM
Lol, well i just installed php, and mysql, and they began working by themselves. All i had to do, was tell my server that php exsisted, and that the file extension was .php :) Anyway, i tried it, and it didn't work, but i just found out how to set your password, so i'm going to try again :P
EDIT: ok, i'm making progress, i now have dreamweaver opening on my computer every half hour LOL, i think an easy way to get around it though, would be to make an html file, that redirects to the php file, because it would open in a browser. Do you know if there might be a way to prevent the window from actually opening though? Like, if just cron jobs could just go in there, and do it without showing me?
EDIT: Actually this is just too hard, it pops up in a window, and is all messed up, and wont even do the query. I think i'm just going to move this all to hm :P the only problem is, that i dont really want to have "http://kingdomsofbattle.shwaza.hostmatrix.org" because that's a beast of a url :P I was wondering if i could maybe be able to request another subdomain as an addon to my account? Like, it would use my resources, but just be like kingdomsofbattle.hostmatrix.org?
EDIT3: lol, ok so it's official everything is moved to hm :D Now i just have a question about setting up cron jobs. Where it says "email to send output" what should i put there? I don't want it to email me every half hour :P
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.