Author Topic: CRON JOBS  (Read 1889 times)

Offline npshmear

  • Level 6
  • *
  • Posts: 26
  • Reputation: +0/-0
    • View Profile
CRON JOBS
« on: November 27, 2006, 10:14:02 PM »
Hello anyone who can help.

I've made a thread for all those (including myself) who are having trouble finding information on CRON JOBS!

Basically I want to know HOW to set up CRON JOBS with the following elements, and how to direct the job for a specific time to a specific file.

I have an FTP Program to upload files.  I use Geocities PRO (Paid server host).  I have a file that will update my turns called turnupdate.php and i want the cron to run every 15 minutes.  I can use myPHPadmin and mysql databases.  that is all!

With my ftp program i upload all my files to the server.  How do i set up crons?

Thanks for the info ahead of time :)

npshmear
« Last Edit: November 27, 2006, 10:41:03 PM by npshmear »

Offline Cripple

  • Level 17
  • *
  • Posts: 170
  • Reputation: +10/-4
    • View Profile
Re: CRON JOBS
« Reply #1 on: November 28, 2006, 12:05:38 AM »
i had the same problem a little while ago - firstly check with ur host that they actually have crontabs.
i use another host to run my crons because the shitty host i use don't have crons.
the new host i am using (ej.am) have 2 options,
1. basic style (very simple)
2. advanced (unix style)

there are heaps of tutes available on web. they look kinda confusing at first - well it did to me. but even i got there eventually!

this might help u understand the table structure:
http://www.adminschoice.com/docs/crontab.htm

other ppl might be able to clear things up better than i can - i'm only a newb.

Offline robot

  • Level 6
  • *
  • Posts: 26
  • Reputation: +0/-0
    • View Profile
    • PhpGame
Re: CRON JOBS
« Reply #2 on: November 28, 2006, 12:40:05 AM »
You should contact you web hosting customer service and ask them how to create a cron job provided it has a cron job feature.
I'm having problem to set up my cron job too initially. I'm using directadmin and the web hosting guy did guide me over the problem

Offline npshmear

  • Level 6
  • *
  • Posts: 26
  • Reputation: +0/-0
    • View Profile
Re: CRON JOBS
« Reply #3 on: November 28, 2006, 10:26:27 AM »
You should contact you web hosting customer service and ask them how to create a cron job provided it has a cron job feature.
I'm having problem to set up my cron job too initially. I'm using directadmin and the web hosting guy did guide me over the problem

Thanks alot to you (and the guy above) geocities doesnt have it (at least i couldnt find it) so I'm going to switch over to a newer webhost with MORE features for less money!  probably at the end of december when i can get some more money!

but thanks

Offline Cripple

  • Level 17
  • *
  • Posts: 170
  • Reputation: +10/-4
    • View Profile
Re: CRON JOBS
« Reply #4 on: November 28, 2006, 05:47:52 PM »
You should contact you web hosting customer service and ask them how to create a cron job provided it has a cron job feature.
I'm having problem to set up my cron job too initially. I'm using directadmin and the web hosting guy did guide me over the problem

Thanks alot to you (and the guy above) geocities doesnt have it (at least i couldnt find it) so I'm going to switch over to a newer webhost with MORE features for less money!  probably at the end of december when i can get some more money!

but thanks

u can still keep ur files on ur existing host & use a new host to run ur crons.
that's what i am doing atm. saves a bit of grief.

Offline npshmear

  • Level 6
  • *
  • Posts: 26
  • Reputation: +0/-0
    • View Profile
Re: CRON JOBS
« Reply #5 on: November 28, 2006, 05:55:14 PM »
was thinking about it thed I found this amazing host so I'm just going to do a HUGE switch all together!

Offline Broda

  • Level 13
  • *
  • Posts: 97
  • Reputation: +2/-0
    • View Profile
    • Nightfall Games
Re: CRON JOBS
« Reply #6 on: March 23, 2007, 08:18:33 AM »
Ok, last night (well, earlier this morning LOL) I was testing the setup of a cron job on my host using a php file and I thought I'd share a quick tidbit.

To run a php script with using wget oranything that requires an actual public address to run use this as the cron job command:

php -q /full/server/path/crons.php

I setup the crons.php file to not output anything, it basicly just runs some SQL commands on the database and sends the results via email to me. I don't know if this is the best way to do it but it worked pretty well. The -q seems to be the key as well. Earlier in the evening I just tried php /path/crons.php and it didn't work. I haven't bothered looking up the -q switch to know what it does maybe "quiet" or something but I thought I'd share.

With this scheme I could also put the script in a public folder (in this case I put it in cgi-bin) and set the permissions to 400 - read-only for user only.

Offline Zeggy

  • Global Moderator
  • Level 35
  • *****
  • Posts: 1,187
  • Reputation: +13/-4
    • View Profile
Re: CRON JOBS
« Reply #7 on: March 23, 2007, 02:14:29 PM »
If you want to protect your cron job files, you should put them somewhere outside of public folders, like in your root folder. (in "/")

Offline Broda

  • Level 13
  • *
  • Posts: 97
  • Reputation: +2/-0
    • View Profile
    • Nightfall Games
Re: CRON JOBS
« Reply #8 on: March 23, 2007, 02:26:56 PM »
I will probably move it and have a folder like /crons. This was only for testing and some of the things I tested used wget which needed to be in a publicly accessibly folder.

Offline Kimmybwoy

  • Level 15
  • *
  • Posts: 124
  • Reputation: +2/-6
  • My Topics Are Random, gets more interest
    • View Profile
Re: CRON JOBS
« Reply #9 on: July 05, 2008, 11:58:15 AM »
When uploaded in host , you have a chance to do cron jobs

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal