crazyweblist.com crazyweblist.com
   Main About Us Privacy of Info Terms of Use Add Url Add Article
Search:   
 
 

How eBooks Can Be Used As An Online Business

Times are hard today! Though the economic data would indicate otherwise, we are now facing a world e ... - Andy George
 

Lance Rants on Foreigners Who Trash on the United States in Online Blogs

May I please remind you in case you have not heard or come from a secluded background with skewed Wo ... - Lance Winslow
 

Affiliate Marketing: Starting Out On The Internet

Starting out as an online entrepreneur has never been easier. The task of acquiring traffic though r ... - Gene Leshinsky
 
 

Spyware Prevention: Here Are Four Ways To Block Spyware

Your privacy is under serious threat by the constant growth of spyware and it needs your urgent atte ... - Garry Allen
 

Incentives in Affiliate Marketing

A properly established affiliate marketing program will pave the way to more sales for the online bu ... - Peter Garant
 
 

Main » Internet & Computers » PC Resources
 

How To Automate Tasks In Your Linux Server

 

Author: Bernard Peh

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 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.

You can also reach this article by using: pc world, tablet pc, pocket pc, metro pcs, pocket pc software, pocket pc freeware, pc anywhere, pc repair
 
 
 

Related Articles

 
Essentials of an Effective Backup Strategy
 
Co-Registration Explained
 
Online Marketing: Math or Myth?
 
24 Tips To Set Up An Effective Email Marketing Campaign - Part 1
 
Staying Motivated And Maintaining A Laser-Like Focus In Your Quest For Website Marketing Success
 
2 Ingredients Your Podcast Is Missing and Why Using Them Will Increase Subscribers
 
Design vs. SEO: Can My Site Look Good and Rank Well?
 
The Power of Price Per Click Advertising
 
Broadband Internet by Satellite and Bad Weather Issues
 
Broadband Internet - Changing Broadband Providers the Simple Way
 
 
 
 

Self Enhancement

 

Medicine & Treatment

 

Science & Research

 

Teens & Children

 

Fitness & Health

 

Tour & Travel

 

Companies & Business

 

Outdoor & Sports

 

Jobs & Employment

 

Automobile & Automotive

 

Property & Estate

 

Music & Entertainment

 

People & Communities

 

Culture & Art

 

Lifestyle & Fashion

 

Internet & Computers

 

Policies & Law

 

Events & News

 

Home & Garden

 

Games & Play

 

Education & Reference

 

Shopping Online

 

Food & Recipe

 

Finance & Investment

 
Main Privacy of Info Terms of Use  
© 2006 www.crazyweblist.com - All Rights Reserved