<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7150224707534930080</id><updated>2011-07-07T17:58:37.904-07:00</updated><title type='text'>cron : unix job scheduler</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://iwaves-cron.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150224707534930080/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://iwaves-cron.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>iWaves</name><uri>http://www.blogger.com/profile/08728718814320197657</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='15' src='http://3.bp.blogspot.com/_3JmaxFNtG-A/Sjtjne2cSlI/AAAAAAAAAGA/n_Eu7_1nnBU/s1600-R/16168650_1.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7150224707534930080.post-1206463929704699410</id><published>2009-06-27T11:05:00.000-07:00</published><updated>2009-06-27T11:09:37.404-07:00</updated><title type='text'></title><content type='html'>&lt;span style="font-size:78%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;cron&lt;/span&gt;&lt;/span&gt; is a unix  utility that allows tasks to be automatically run in the background at regular intervals by the cron daemon. These tasks are often termed as cron jobs in unix (e.g.  solaris).&lt;br /&gt;Crontab (CRON TABle) is a file which contains the schedule of cron entries to be run and at specified times.&lt;br /&gt;&lt;br /&gt;Cron is a daemon, which means that it only needs to be started once, and will lay dormant until it is required. Like a Web server is a daemon, it stays dormant until it gets asked for a web page. The cron daemon, or crond, stays dormant  until a time specified in one of the config files, or crontabs.&lt;br /&gt;&lt;br /&gt;To find out if it's running do the following:&lt;br /&gt;&lt;br /&gt;$ ps aux | grep crond&lt;br /&gt;root       311  0.0  0.7  1284  112 ?        S    Dec24   0:00 crond&lt;br /&gt;cog       8606  4.0  2.6  1148  388 tty2     S    12:47   0:00 grep crond&lt;br /&gt;&lt;br /&gt;The top line shows that crond is running, the bottom line is the search we just run.&lt;br /&gt;To run it without rebooting, just type crond as root:&lt;br /&gt;&lt;br /&gt;root@pingu # crond&lt;br /&gt;&lt;br /&gt; 1. Crontab Restrictions&lt;br /&gt;____________&lt;br /&gt;You can execute crontab if your name appears in the file /usr/lib/cron/cron.allow. If that file does not exist, you can use crontab if your name does not appear in the file /usr/lib/cron/cron.deny. If only cron.deny exists and is empty, all users can use crontab. If neither file exists, only the root user can use crontab. The allow/deny files consist of one user name per line.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. Crontab Commands&lt;br /&gt;__________&lt;br /&gt;export EDITOR=vi ;to specify a editor to open crontab file.&lt;br /&gt;&lt;br /&gt;crontab -e     Edit your crontab file, or create one if it doesn't already exist.&lt;br /&gt;crontab -l      Display your crontab file.&lt;br /&gt;crontab -r      Remove your crontab file.&lt;br /&gt;crontab -v      Display the last time you edited your crontab file. (This option is only available on a few systems.)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Crontab file&lt;br /&gt;___________&lt;br /&gt;Crontab syntax :-&lt;br /&gt;A crontab file has five fields for specifying day , date and time  followed by the command to be run at that interval.&lt;br /&gt;*     *   *   *    *  command to be executed&lt;br /&gt;-     -    -    -    -&lt;br /&gt;|     |     |     |     |&lt;br /&gt;|     |     |     |     +----- day of week (0 - 6) (Sunday=0)&lt;br /&gt;|     |     |     +------- month (1 - 12)&lt;br /&gt;|     |     +--------- day of month (1 - 31)&lt;br /&gt;|     +----------- hour (0 - 23)&lt;br /&gt;+------------- min (0 - 59)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;* in the value field above means all legal values as in braces for that column.&lt;br /&gt;The value column can have a * or a list of elements separated by commas. An element is either a number in the ranges shown above or two numbers in the range separated by a hyphen (meaning an inclusive range).&lt;br /&gt;&lt;br /&gt;Note: The specification of days can be made in two fields: month day and weekday. If both are specified in an entry, they are cumulative meaning both of the entries will get executed .&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7150224707534930080-1206463929704699410?l=iwaves-cron.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iwaves-cron.blogspot.com/feeds/1206463929704699410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://iwaves-cron.blogspot.com/2009/06/cron-is-unix-utility-that-allows-tasks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7150224707534930080/posts/default/1206463929704699410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7150224707534930080/posts/default/1206463929704699410'/><link rel='alternate' type='text/html' href='http://iwaves-cron.blogspot.com/2009/06/cron-is-unix-utility-that-allows-tasks.html' title=''/><author><name>iWaves</name><uri>http://www.blogger.com/profile/08728718814320197657</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='15' src='http://3.bp.blogspot.com/_3JmaxFNtG-A/Sjtjne2cSlI/AAAAAAAAAGA/n_Eu7_1nnBU/s1600-R/16168650_1.jpg'/></author><thr:total>0</thr:total></entry></feed>
