weblistingster.com weblistingster.com weblistingster.com
Search:    Main Page :> About Us :> Privacy :> Terms & Conditions :> Add Url :> Add Your Article   
Free links exchange
 

Healthcare & Treatment

Technology & Science

Education & Learning

Property & Estate

Self Help

Culture & Art

Politics & Government

Jobs & Careers

People & Society

Cooking & Drinking

Indoor Games

Automobile & Automotive

Computers & Software

Finance & Investment

Issues & News

Shopping & Auction

Travel & Accommodation

Garden & Home

Music & Entertainment

Teens & Kids

Fashion & Lifestyle

Health & Therapy

Adventure & Sports

Business & Commerce


 

Main Page » Computers & Software » PCs
 

How To Automate Tasks In Your Linux Server

 

If your host is running under the Linux (Unix) operating system, you can perform tasks in the server on a regular basis. For example, sending mails at a certain time of the day, backing up database at 6 in the morning and so on.

"Cron" is a program that runs in the background of the Linux server. The program runs certain commands defined by you at fixed time intervals. A tyical cron file will look something like this:

# My Sample Cron File 12 01 02 * * /usr/bin/du /var > /home/test/diskSpace.txt

Cron command lines consist of 6 whitespace separated fields. The first 5 fields are used to specify when to run the command, and the last field determines what command to run. The first field(12 in this case) represents minute, the second field represents hour, third field represents day of month, fourth field represents month(1=Jan, 2=Feb and so on), fifth field represents day of week(0=sunday, 1=monday and so on).

Note: * means every time and # means comments.

To edit the crontab file, we use the crontab command like so:

"crontab [ -e | -l -r ]"

The switch -e means to edit the current cron file. -l means to list the current file, and -r means to remove the current cron file. Try typing "crontab -l" and you will see the cron file contents. To access the crontab command, you need to have SSH(Secure Shell) access to the server. Basically, SSH allows you to type commands in the command prompt. If you have limited access to SSH, your host might provide some other ways to access cron via the control panel.

For example, if I want to run a php script at 12 midnight everyday, I will type "crontab -e", then write my script as follows:

0 0 * * * php /home/username/public_html/www.sitecritic.net.php

The command that I run is "php". It is also recommended that you use full path reference to your script. In this case, it is /home/username/public_html/www.sitecritic.net.php.

In Conclusion, cron can save you alot of time and effort in doing daily repetitive tasks. By running a customised php script, you can automate the task of sending mass mails, backing up database, creating RSS feeds...etc.

Author: Bernard Peh
 
Author Bio:

Bernard Peh

Bernard Peh is a great passioner of web technologies and one of the co-founders of Sitecritic.net Site Reviews. He works with experienced web designers and developers for more than 5 years, developing and designing commercial and non-commercial websites. During his free time, he does website reviews, freelance SEO and PHP work.

 
 
 

Related Articles

 
Don't Use FFA's To Build Your Newsletter Subscriber
 
How to Avoid a Phishing Scam
 
Make Money Selling Other People's Products: Affiliate Marketing
 
Computers and Data Storage: How Much Disk Storage Do You Really Need?
 
Income Tax Software
 
HIPAA and the Internet: Requirements for Intranet Collaboration Software
 
The Newbie's Guide to Personal Computer Maintenance
 
Write E-Mails That Sell: 5 Easy Ways to Improve Your Email
 
Customer Newsletters: Are You Neglecting Yours?
 
How To Increase Adsense Income
 
 
 
 

The Google Adwords Ranking Algorithm Simplified

Google Adwords is the largest payper click program on the internet today. Yahoo Search Marketing Ser ... - Gabriel J. Adams
 

Surfboard Lighting Concept

There is just not enough time during the day to surf. Many times the best surf is at night, how ofte ... - Lance Winslow
 

Search Engine Optimization : How to Put Your Web Site on the Map

Millions of people search the internet for products and services. Search engine optimization using e ... - Fabio Braghi
 
 

IS Permission Email Marketing In Trouble... And Is RSS The Answer?

This article goes into depth about Permission Email Marketing and how its in trouble as a marketing ... - styles98
 

Rules for Achieving Online Success

The Internet brought a great deal of benefits to our life. Access to a lot of free and useful inform ... - Nowshade Kabir
 

Article Directories: A Match Made In Heaven?

Most marketers realize today that content is king and there is no faster vehicle to increase traffic ... - Larry Cockerham
 

Feed Your Blog With Google Alerts to Save Time and Energy

Imagine having your own Web-crawling robot, surfing the Internet 24/7 to find relevant information y ... - Brandon Cornett
 

Use the Web to Boost Profit at Trade Shows

Learn tips on how the Internet can increase traffic and profit to your trade show display. Find out ... - Dick Wheeler
 
 
Main Page :> Privacy :> Terms & Conditions  
© 2008 www.weblistingster.com All Rights Reserved.