Crons — A Simple Tool To Automate Your Business

Sunday, March 16th, 2008

How Crons can be an asset to  your business.

What is Cron?

Cron is the name of a time based scheduling program that enables Unix users to execute scripts, or commands, automatically at a specified time/date. It is generally used for system administration commands, for running a backup script, or for connecting to the internet and downloading your email.  Now you’re interested, right?  Email is something that almost everyone, certainly every business owner, can relate to. 

So how can you use Crons? 

Quite simply, If you want to automate something on your computer that runs more than once, you can use a cron.

But wait, we’re getting ahead of ourselves.  Let’s take a step back and examine exactly what a cron is. 

A cron is a daemon, yep another tech term – sorry.  A daemon is a program that only needs to be started once and then it will sit quietly waiting until it is required.  Most Linux distributions, versions of Linux designed from the original Linux base code called a kernel, come with Crons automatically installed and entered into the startup script. 

For example, you can write a cron to delete your temporary files.  You can designate it to delete them hourly, daily, weekly, or monthly. 

Even more useful for an internet business owner might be the ability send email messages to subscribers every morning at 5:00am.  You can set the cron job on your server to handle that every day.  You can even set your cron to send one email every day until all your email messages have been delivered.  You can schedule it to delete your website members with expired accounts, to receive an update on your subscribers from your mailing list manager and you can investigate your links on other websites if participate in link exchange programs.  Pretty useful, right? 

Another term you’re likely to come upon as you get into crons is the term Cron tab.  This is basically the command that creates the list of commands on your system and is not editable.  However, the crontab file, I know, the creators of the terminology must get a good laugh from confusing folks, the cron tab file is the actual list of commands and that is capable of being edited with a few commands.  Each user can have their own cron tab file. 

What does a Cron Look like?

The good news is that it is fairly simple.  You have a few fields you will use including:

Minute - denotes the minute of the hour that the command will run, anything between 0 and 59.

Hour – denotes the hour the command will run on and will be between 0 for midnight and 23 for 11pm.

Dom – this is the day of the month you want your command to run on.  For example the first day of the month would be denoted as 1.

Month – what month do you want to run the command, choices are 0-12 or you can write the name of the month out.  For example, October

Dow – stands for day of the week and you can choose 0-7 or write the day as it is normally abbreviated.  Example Sat would mean Saturday

User – is the person that runs the command.  You can specify a user but you do not have to.  You can also deny a user from using a cron with a simply deny command.

Cmd – is the command that you want to run.

Here’s what a typical cron command will look like.
 
Let’s imagine that you have installed a cgi script called task.cgi in your cgi-bin directory.  If you want to run this program each morning at 5:15am on Sunday, here’s what it will look like:

15 5 * * 0 /home/username/www/cgi-bin/task.cgi

30–represents the minute of cron work
23–represents the hour of the day
0–represents the Sunday.
The * represent every day, month, and weekday.

Scenarios you may face

Many distributions offer pre-configured cron jobs.  Different versions of UNIX store cron and support files in different locations and may use a slightly different format however if you have a Linux system you may be able to view these with the following commands:

• /var/spool/cron               main cron directory
• /var/spool/cron/cron.allow    grant access to the cron facility
• /var/spool/cron/cron.deny     revoke access to the cron facility

To set up a cron job your system may have a cron tab function on your web panel.  This is a simple interface that will allow you to click on a few buttons and set your cron job. 

The last option is that you will have to upload a cron job into your ‘cron.txt’ file.  There are four basic steps involved and they include Create cron.txt using your notepad application, uploading it using your telnet server, installing the txt file as cron file with the command ‘crontab cron.txt’, and then checking it to see if it works. 

Tips in setting up your cron jobs include:

• Occasionally check your cron to make sure if it is working.  For example you set your cron to send your ezine at 11.30 PM. Then you subscribe yourself to see it is working or not. Later you can unsubscribe yourself.

• If you are creating cron file first time and uploading it to your server, do it in ASCII mode.

• If you are setting the script path in your schedule, the path SHOULD be from your hosts server root. NOT your domain path.  Ask your host about the procedure if you are not sure of something.

• Script names are case sensitive on Unix. So be careful in entering the script name.
If you are creating cron.txt file and uploading, you should not allow spaces between them however you should have a space after your command.

Wrapping it up

It is easy to get excited about the possibilities of crons and automating your business and computer to work while you sleep without the extra cost of additional software.  Before you get carried away take the time to understand your server’s set up and capabilities.  Some systems are significantly more intuitive and programming crons is easy.  Others will require more attention and a longer learning curve.   This article merely scratches the surface of what crons are capable of and how to implement them. 

Social Bookmark #del.icio.us #Digg it #Earthlink #Furl #iFeedReaders #ma.gnolia #Maple.nu #Netvouz #Netscape #RawSugar #reddit #Scuttle #Shadows #Simpy #Spurl #StumbleUpon #Wink #Yahoo MyWeb

What Is MySQL And Does Your Business Need It?

Saturday, January 12th, 2008

What Is MySQL And Does Your Business Need It?

What is MySQL?  

First released in May 23, 1995, MySQL is an open source database software.  It is part of a large and growing family of open source software including Linux, Apache, and programming languages PHP and Perl. 

However, unlike many open source products where the copyright is owned by the individual authors or distributors, MySQL is owned and sponsored by a single for-profit firm, MySQL AB, which holds the copyright to most of the codebase. They develop and maintain the system, sell support, service contracts, and proprietary-licensed copies of MySQL.

MySQL is a relationship database, which is a collection of items or tables organized into predefined categories or described tables from which data can be accessed or reassembled in many different ways without having to reorganize the database tables.  This format is enormously popular with more than 100 million copies of the software downloaded over the life of MySQL.  The popularity stems from the fact that the databases are easy to create and access.  Additionally, they are easy to extend, a new data category can be added without requiring that all existing applications be modified.

When creating a relational database, you can not only extend the data, you can define the domain of possible values in a data column and any additional constraints that you want to apply to the value of your data.  This makes your information significantly more valuable and user friendly.

Uses of MySQL

There are many uses of MySQL for a business and you can find many significant case studies at http://www.MySQL.com/why-MySQL/case-studies/.  Among them are many stories about how information generated from MySQL has saved IT teams thousands of man hours and thousands of dollars. 

Here’s an example of how you can use it for your business.  Consider a typical order entry database.  It might include the following columns for customer information:  name, address, and phone number.  

Another table might describe an order and have these columns: product, customer, date, and sales price.  This table and the relevant information could be used to show a report on all customers that bought products on a specific date. A financial services manager in the same company could, from the same tables, obtain a report on accounts that needed to be paid.

Craigslist uses MySQL to power more than 50 forums, among many other things, and Yahoo Finance uses it to aggregate headlines for its website.

Benefits of MySQL

Ease of use.   A basic knowledge of SQL and database manipulation is required however MySQL is logical and easy to use. This means you don’t have to spend as much time and money either training existing staff, or hiring developers.

Security. There are not a lot of databases that can compare to the security that MySQL offers.  It includes solid data security layers that protect your sensitive information.  Rights can be set to allow some or all privileges to either individuals or groups. Passwords are encrypted.  The access to your database can be controlled by a remote machine that can completely control what a user can view. The system can be locked down even more through the operating system.

Capacity and memory.  MySQL can handle almost any amount of data from only a few rows to as much as 50 million rows or more.  The default file size limit is about 4 GB.  It manages memory very well, which means it functions efficiently and speedily without crashing or dumping your information.  Additionally, MySQL server has been thoroughly tested to prevent memory leaks.

Unbeatable flexibility.  MySQL runs on many operating systems, including Novell NetWare, Windows, Linux, and UNIX

It supports several development interfaces including JDBC, ODBC, and scripting languages including PHP and Perl.  This enables you to create database solutions that run on all major operating systems, including Linux, UNIX, and Windows.

More than one person can access business information at a time. This means that a large group of people can access the information at once but there can also be several connections at one time.

Multiple storage engines, or types of table, allow you to choose which one is most effective.

Commit grouping, gathering multiple transactions from multiple connections together to increase the number of commits per second.

Technical support.  One of the drawbacks to many open source products is the fact that the support is sometimes nonexistent or slow to respond at best.  The products are free or close to free so it’s a trade off.  However, MySQL Enterprise offers support itself, including 24/7 30-minute response time and the support team has direct access to the software developers.

Licensing.  We’ve already discussed the fact that open source products are extremely cost efficient!  MySQL AB makes MySQL Server available as free software, but they also offer the MySQL Enterprise subscription offering for business users and dual-license it under traditional proprietary licensing arrangements for cases where the intended use is incompatible with the General Public License agreement.

Drawbacks of MySQL

Early versions of MySQL lacked many standard relational database management system (RDBMS) features, usually with the goal of trading guaranteed accuracy for speed. Many (but not yet all) such criticisms have been remedied in later versions of the software, including transactions and relational integrity constraints.

Some say that MySQL’s feature list leaves something to be desired, but its fans swear that a scaled-down feature set means you only have to deploy, configure and maintain what you need.

There are also a few common errors such as out of memory or packet too large they generally relate to the configuration of the server and are uncommon and the errors are fairly easy to remedy. 

Bottom Line:

The uses of MySQL are seemingly endless and for a business the information gathered is priceless. Combined with PHP, it can be used to create dynamic web pages.  If you’re using any type of web 2.0 technology like forums, online ordering, subscription forms etc…must utilize a database of some sort to gather and analyze the information.  When it comes to database technology, there really isn’t anything that beats MySQL for stability, price, and ease of use. 

Social Bookmark #del.icio.us #Digg it #Earthlink #Furl #iFeedReaders #ma.gnolia #Maple.nu #Netvouz #Netscape #RawSugar #reddit #Scuttle #Shadows #Simpy #Spurl #StumbleUpon #Wink #Yahoo MyWeb

Pros And Cons Of Linux - Is It Right For Your Business?

Monday, November 26th, 2007

Pros And Cons Of Linux. Is It Right For Your Business?

What is Linux? 

Linux is an operating system, like Microsoft Windows, MacOS, or Unix.  It was created as a hobby by Linus Torvalds, a student at the University of Helsinki in Finland.  What most people don’t know about Linux is that its source code is available to anyone.  The Linux source code is called the kernel and it is the base of the Linux operating system.  Because the source code or kernel is free, it has enabled hundreds of companies and individuals to release their own operating systems based on the Linux system.  These operating systems or formats are often referred to as Linux distributions. 

Each distribution has its own set of features and functionality that makes it unique.  While Linux is generally considered free-ware and people associate that with no cost, that is not always the case.  Some distributions are available for download for free and others are available on CD or floppy disk and have a small charge associated with them. You can find a list of distributions at http://www.linux.org/ and a list of applications at http://www.Linux.org/apps/

Because if the adaptability of Linux it has been embraced and supported by a number of operating systems and software programs.  For example, IBM, Hewlett-Packard and other giants of the computing world have embraced Linux and support its ongoing development and openoffice.org and Mozilla run on Linux.  US retailing giant Wal-Mart began selling Linux systems back in 2002 -  if Wal-Mart isn’t mainstream, nothing is. 

What are the benefits of Linux?

Many people fear that Linux is going to be difficult to work with or that it will be difficult to find software that will run on Linux however Linux is a very standard operating system, compatible with just about any software you need.
 
Beyond being a standard operating system, Linux supports open source software which makes it a very economical operating system, especially if you program your own software.  It offers many free or low cost applications which include, basic desktop applications like web browsers, email programs, word processing programs, spreadsheets, graphics programs, and file managers.

Linux can easily operate as a central server for your business. With Linux, you can serve your own web pages up for public consumption and handle your own email.

Linux doesn’t require top of the line hardware though many recommend you have at least 256 MB of RAM and at least 4 GB of space in your hard drive.

Linux is considered to be extremely stable and doesn’t need to be rebooted periodically to maintain performance levels. Think about the last time you sat at your computer and it froze.  Not fun, right?  That doesn’t happen with Linux if it is configured correctly. 

Linux isn’t going to be replaced anytime soon and when bugs are found in the system, a developer are quickly on the job and often times a solution is offered within a matter of hours, not months or years like many other operating systems.

Linux is also fast and can handle a number of tasks at the same time. 

Linux also claims to be one of the most secure operating systems isn’t plagued with the viruses that other operating systems generally deal with. 

Linux is free from having to upgrade it or deal with proprietary file formats and licensing fees.  You don’t have to register it due to its open source format.  

You can have both Linux and windows on your computer.  (You’ll have to partition them on your hard drive and you can only boot them one at a time.)

Drawbacks of Linux

There is no 1800 customer service number to call.  However, most distributions offer a support number or email to call if you find a bug.  They also generally come with installation instructions.

You cannot run applications for MS windows on Linux.  However, there are Linux emulators or applications that enable you to run some windows applications on your Linux system.  They operate like a translator.  Some of these ‘translation or emulator’ products are free and others are available for a price.

Linux is not able to run some advanced financial applications or reproduce some proprietary multimedia formats.

Tips and Advice:

Choose a popular distribution has a large developer community. A large developer community means that you’ll find the programs that you need easily and you will be able to install them with the same ease. The more well-known distributions have prepared programs in ‘packages’ that are easy to install. On top of this, there are tools designed especially for a particular distribution to manage these packages to make sure that programs run correctly right away. The website Distrowatch.com maintains a comprehensive list of the most popular distributions.

Get the latest version of your chosen distribution.  The newer the Linux distribution version, the better the hardware support. The number of glitches you’ll get in the installation process decreases with the newness of the version of Linux you choose.

Consider paying for your Linux distribution.  It is true that you can get a full-featured Linux operating system free of charge by downloading it from any number of sources. This is an excellent alternative to an operating system like Windows, which either comes pre-loaded with a newly purchased computer (which gets figured into the cost), is bought separately or copied ‘illegally’. In most people’s experience, the popular Linux distributions are easy to install. However, if you do run into some glitch (normally hardware related), you may have a frustrating experience. Although there are a number of excellent Linux support forums out there, personalized advice on your particular problem may be hard to find.

Use an appropriate computer.  if you want to use Linux to do the same things that you would with Windows XP or Mac OS X, then you’ll need the newest computer you can get your hands on. Avoiding ‘elite’ video cards and new, exotic hardware will also work in your favor because you won’t have to deal with hardware support which may be inferior to hardware support from other operating systems. 

Bottom Line:

Linux is a fantastic and powerful operating system that can handle most or all of your operating needs.  It is secure, fast, reliable, and generally extremely cost effective.  When purchased or obtained through a reliable distributor and installed and configured correctly there are virtually no drawbacks to running Linux.  Additionally, you don’t have to give up your windows if you don’t want to.

MemberSpeed Content Management software can run on any Linux Any Linux based Hosting Platform (Preferably RHEL 3 or above).
 

Social Bookmark #del.icio.us #Digg it #Earthlink #Furl #iFeedReaders #ma.gnolia #Maple.nu #Netvouz #Netscape #RawSugar #reddit #Scuttle #Shadows #Simpy #Spurl #StumbleUpon #Wink #Yahoo MyWeb