Closed Thread
Results 1 to 5 of 5

Thread: Cron Jobs

  1. #1
    inadim8956 is offline x10Hosting Member inadim8956 is an unknown quantity at this point
    Join Date
    Sep 2010
    Posts
    41

    Cron Jobs

    I would like to know how to set a cron job ...

    First, there is an E-Mail field, what is the use of it?

    Second, I want to know the command string of the cron job, and what is the maximum number of cron jobs per minute, and what is the time difference between each cron job and the other?

  2. #2
    inadim8956 is offline x10Hosting Member inadim8956 is an unknown quantity at this point
    Join Date
    Sep 2010
    Posts
    41

    Re: Cron Jobs

    anyone?

  3. #3
    Livewire's Avatar
    Livewire is offline Abuse Compliance Officer Livewire is a glorious beacon of lightLivewire is a glorious beacon of light
    Join Date
    Jun 2005
    Location
    Behind a keyboard.
    Posts
    8,995

    Re: Cron Jobs

    I left this cause I didn't know all of them but since there's no reply I'll answer the ones I can:

    Email field: a cronjob sends you an email with the output of every script. This is good for telling if a cronjob errored, but bad if you put your normal email - you'll get a -ton- believe me.

    Command string varies from cron-to-cron, so that one's tricky to provide.

    Maximum number of cronjobs per minute on free is 5 minutes, and this is also the space that must pass between this cron and every other cron on the account. If two crons try to run within 5 minutes of each other, the system will clear both cron-jobs out of the system (it won't suspend, but they'll disappear).


    TOS breakers will be suspended regardless of race, creed, national origin, hair color, or favorite food. Thanks for your understanding!

  4. #4
    inadim8956 is offline x10Hosting Member inadim8956 is an unknown quantity at this point
    Join Date
    Sep 2010
    Posts
    41

    Re: Cron Jobs

    OK, so when I go to the CPanel and set a cron job, I want to know what I write in the commmand ... I create script from scratch and some of them need to run every day or hour or so.

    What should I write then?!!

  5. #5
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,633

    Re: Cron Jobs

    1. The email field has been disabled. Otherwise it would flood x10hosting's mail server.

    2. Assuming it is a PHP script ...

    Code:
    /usr/bin/php /home/USERNAME/public_html/cronscript.php  >> /home/USERNAME/public_html/cronlog.txt  2>&1
    where USERNAME is your cPanel username.

    cronscript.php is your script. It actually can be anywhere on your site. Many prefer to put it above public_html for security reasons, since if it is in (or in a subdirectory of) public_html it can be run from the Web. Good for testing, bad for security.

    The

    Code:
    >> /home/USERNAME/public_html/cronlog.txt  2>&1
    will send any script output or error message to a log file that you can inspect to make sure your cron job is actually being run. With the email notification being disabled, there is no other way of seeing that either the cron daemon has stopped or you made a mistake in your command (mistyped the file name, etc).
    Nothing is always absolutely so.

Closed Thread

Similar Threads

  1. Cron Jobs
    By froger in forum Programming Help
    Replies: 3
    Last Post: 10-17-2010, 09:45 PM
  2. Cron Jobs
    By gameserv15 in forum Free Hosting
    Replies: 1
    Last Post: 06-26-2010, 03:14 AM
  3. cron jobs
    By jinx001 in forum Free Hosting
    Replies: 4
    Last Post: 12-05-2007, 09:59 AM
  4. cron jobs help
    By Killa619 in forum Free Hosting
    Replies: 4
    Last Post: 11-13-2007, 05:02 AM
  5. Cron Jobs
    By Hated in forum Free Hosting
    Replies: 3
    Last Post: 10-19-2007, 08:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers