Go Back   Cloud Computing > Support > Control Panel Forum
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 09-20-11, 19:02
BOD Member
 
Join Date: Sep 2011
Posts: 1
Default Basic commands and parameters of CRONJOB in Linux

Basic commands and parameters of CRONJOB in Linux
How to setup Basic Cron Jobs

The CRON Command is in the Following Format

[ Minute - Hour - Day - Month - Weekday ] - Command
The COMMAND, can be broken down in

[PATH OF PHP] [ARGUMENTS] [PATH OF PHP SCRIPT]
So the COMPLETE CRON command can be written as

[ Minute - Hour - Day - Month - Weekday ] [PATH OF PHP] [ARGUMENTS] [PATH OF PHP SCRIPT]
The timing is spedified using * symbols

Quote:
* * * * * => Execute every minute
0 * * * * => Execute every Hour
0 0 * * * => Execute every mid-night
0 0 0 * * => Execute every Month
0 0 0 0 * => Execute every Weekday
If you did not understand anything till now.. Good, this means you are a noob.. Read ahead

Since this is a UNIX command, You will have to Mention the PATH of PHP. At Astahost,

PATH TO PHP : /usr/local/bin/php
( it also same at trap17, if users over there want to use it )
These are the Possible Command line Arguments you can use. This will effect the output. In our case, we will use the -q ( Quiet mode ) argument.

Quote:
-a Run interactively
-b <address: port>|<port> Bind Path for external FASTCGI Server mode
-C Do not chdir to the script's directory
-c <path>|<file> Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-f <file> Parse <file>. Implies `-q'
-h This help
-i PHP information
-l Syntax check only (lint)
-m Show compiled in modules
-q Quiet-mode. Suppress HTTP Header output.
-s Display colour syntax highlighted source.
-v Version number
-w Display source with stripped comments and whitespace.
-z <file> Load Zend extension <file>.
The Path of the PHP file Must be Complete absolute path.
If you have an Account at TRAP, And your USERNAME is "tom", Your path will be
"/home/tom/public_html/"
I assume you are familier with the PUBLIC_HTML directory. That is the Root folder where you store your html files.
So lets say that Tom wants to execute my script "maintenance.php" every hour. And it is stored in "public_html/cron/maintenance.php";

So the Complete CRON command would be,


Quote:
0 * * * * /usr/local/bin/php -q /home/tom/public_html/cron/maintenance.php
If tom wants to execute it every minute, he would use.


Quote:
* * * * * /usr/local/bin/php -q /home/tom/public_html/cron/maintenance.php
If tom wants to execute it every Month, he would use.


Quote:
0 0 0 * * /usr/local/bin/php -q /home/tom/public_html/cron/maintenance.php
There are more Complex forms of Assigning the TIMINGS for these scripts. You can go to CPANEL => Cron Jobs => Standard and set exact time when the script will be executed.

Also, this method used php, you can also use Curl .

Thanks and regards.
Reply With Quote
  #2 (permalink)  
Old 09-21-11, 04:08
BOD Member
 
Join Date: Sep 2011
Posts: 1
Default forex brokers spread Santa Rosa or forex brokers metatrader

forex brokers compare or best forex broker reviews
__________________
www.ForexTrue.org - forex broker guide Riverside or directory hyip ecurrency trading forex broker inte
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 06:02.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.