Archive for March, 2008

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. 

Share

What is Flash and Does Your Website Need it?

Monday, March 10th, 2008

What is Flash, and Does Your Website Need It?

What is Flash?

Since hitting the market in late 1996, Flash technology has become one of the most widely-adopted ways to add animation and interactivity to websites, and sometimes form the basis for nearly the entire website itself.  The Flash Player is the free application that web users use to view Flash files, and is available for most operating systems and integrates into most web browsers.  Flash technology is distributed by Adobe Systems (which also distributes the popular Acrobat or “PDF” technology), which acquired the technology through a merger with Macromedia in 2005).

Flash files, which are also sometimes known as “flash movies”, have a file extension of “.swf”, and may be an object of a web page, strictly “played” in a standalone Flash Player, or incorporated into a Projector, a self-executing Flash movie with the .exe extension in Windows. Flash Video files have a .flv file extension and are utilized from within .swf files.

The most recent versions of Flash include a technology called “ActionScript”, which has the same syntax as JavaScript, but which has a different programming framework and associated set of class libraries. This ActionScript is used to create the user interactivity in many Flash movies.

Most recently, Flash is being used together with the XML capabilities of the user’s web browser to display dynamic and content in the user’s browser.  Because Flash technology provides more comprehensive support for so-called “vector” graphics than the web browser itself, Flash is a powerful addition to the capabilities of a the browser. This technology is currently in its early stages, and it’s likely to become increasingly powerful in the years to come.

Uses of Flash

The original uses of Flash focused primarily on non-interactive animations and movies.  This is likely due in part to the fact that the software (as well as the computers running the software) was not as powerful as today, didn’t offer the option of significant interactivity, and there were fewer developers with expertise in the relatively new technology.

Flash now permits such a high level of user interactivity that significant portions of a website can be built in Flash, and provide the user with an exciting way to navigate through the website’s content.

Flash is now also an increasingly popular way to display videos over the Internet.  YouTube uses Flash technology to display its movies to users, and the technology can be used to protect video content or force users to watch advertisements before the desired content is displayed.

Benefits of Flash

Free to Web Users.  The most recent version of Flash is always available for download, for free, from the Adobe website.

Versatility.  Flash players are available for use in all major operating systems (including Microsoft Windows, Mac OS, and Linux), and a number of other computing devices.

Wide Adoption Rates.  The Flash Player has already been installed on more than 98% of the Internet-connected desktop computers worldwide.  The current installation rates are even higher, over 99%, in the “mature markets” that include the U.S., U.K. and Canada.

Small Files.  The use of vector graphics, combined with other programming code, allows Flash files to be smaller than standard video clips and bitmapped graphics.  For files that are streamed to users, the smaller size will consume less bandwidth than traditional files.

Fast Player.  Compared to other web browser plug-ins (such as Java, QuickTime and Windows Media Player), the Flash Player has a small install size, a quick time to download, and will quickly initialize in the user’s browser.

Possible Time Savings.  By using the ActionScript programming language, you can save a lot of time by scripting instead of traditional animating techniques.

Adobe Integration.  Because of common elements across the technologies, you may be able to save time and resources if you use other Adobe creative products such as Photoshop, Illustrator or Dreamweaver) to develop your website.

Drawbacks of FlashCost to Developers.  Although the Flash Player is free for download to all users, the Adobe software that is needed to create the Flash movies is not free.  The current retail price of a license for the stand-alone Flash development tool is approximately $700.  There are less-expensive third-party options, but these software packages do not have the full host of features as the Adobe product.

Suboptimal Format for Some Types of Content.  If the content that you want to provide to your users or customers is in a single format (such as text or audio), then other technologies may provide better performance and consume less of your user’s CPU power than a Flash movie.

Small Files, but Maybe Not Small Enough.  Though Flash files are relatively small, their size may still be a problem (or at least a cause of great frustration) for users who are still accessing the Internet through a dial-up or slow DSL connection.

Temptation to Go Overboard.  Because Flash Technology is so powerful and flexible, there is sometimes a temptation to add more and more of the “bells and whistles” to the content that you want to publish.  Sometimes, though, this actually makes the experience worse for the user because it distracts from your message.

Getting Up to Speed.  If your developers have not used Flash before, then it may take some time to learn how to create the Flash movies you envision. Search Engine Issues.  Flash movie files are not themselves crawlable by search engines, which means that if you have important sales or other copy embedded in file, it will not be indexed by Google or any other search engine.

Because of its power and efficiency, Flash technology has been used to power many of the aggressive online advertisements.  In response, many tools and browser plug-ins are available for users to disable the Flash Player in their browsers.  If a user has Flash disabled and is not otherwise able to navigate your website, then they may leave your website and you’ll lose a customer or client.

Bottom Line

Flash technology can be a very powerful tool to make your website a compelling experience for your users.  However, you will need to be sure that your Flash implementation actually serves to help your users, and fits within your budget.

The video and audio players on our MemberSpeed plugins use flash technology in the media players.

Click here to see the how the video player works

Click here to see how the audio player works

Click here to see the audio player in action by listening to any of these podcasts.

Share