Jump to content

A Little Question About Cron


Recommended Posts

Guest Guest_Andrew
Posted

:D heh nice faces :D

 

Hello,

I have a script in public_html directory, let's call it script.php, what command line should I write to execute it? i tried /public_html/script.php but it doesn't work :D

Thanks for any help.

Guest again me
Posted

/bin/sh: public_html/skaiciai.php: Permission denied

this is what i get.... :D

Posted

is this php script designed for being run from a command prompt or from a web page? By default, you do not have access to a shell environment (command line prompt) with TCH.

 

As far as running browser aware php scripts, simply upload it to your public_html directory, then run it from a browser.

 

So, if it is script.php and it is sitting in your public_html directory, you would enter http://www.yoursite.com/script.php

 

As a test, to prove to you that it works, go to the TCH Help Web Site, click on Tools and Scripts, and then download the zipped version of phpinfo.php. Unzip it (one file), and then FTP upload phpinfo.php to your public_html directory.

 

You should then be able to run it from a browser, as: http://www.yoursite.com/phpinfo.php

 

Hope this helps!

kw

Guest Guest_Andrew
Posted

Hello,

I guess You didn't understand me. I want to run a php script every hour using cron. ( system automatically runs my script every hour ). So i go to cPanel then to cron jobs. Then I set time, and don't know what to write in command line to run my script. Thank You.

Posted

Cron, or Crontab as it is sometimes referred, is an application on the server that is used to automatically run programs. It is generally used for system backups but can be used for any job that needs to be scheduled.

 

The Cron Tab feature in the Cpanel give you Web Access to the Cron program. It is a simple way to schedule scripts to run. You can schedule jobs my the hour, day, month and weekday.

 

THIS FEATURE IS FOR ADVANCED USERS ONLY!

 

DO NOT TO ABUSE this feature. In the event that TotalChoice determines that you are abusing the system from your use of this feature, your account could be suspended.

 

If you know how to use Crontab, then you are quite aware of the drain that this feature can cause on server resources.

 

Precautions that you should take are:

 

Limit the number of processes that you run.

Do not run processes every minute.

Schedule your processes to run between midnight and 5:00 A.M. US Eastern Time.

 

Limit the number of processes that you run.

Do not run processes every minute.

Schedule your processes to run between midnight and 5:00 A.M. US Central Time

 

Here is a very good source on this - http://www.redhat.com/support/resources/ti.../cron/cron.html

 

Warning: You need to have a good knowledge of Linux commands before you can use cron jobs effectively.

 

There are many way to execute a php script. Take a look at the links I have provided they will guide you.

Guest Guest_Andrew
Posted

Thanks for the information. By the way, can I run a little script using Cron every hour. Will this be ok? Thanks.

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...