PHP: Inserting source variable in the URL and emailing the value

#1. Setting a Session Variable.
A session variable is needed to hold the source value consistently throughout the site. Set the Session Variable as the very first item (line1) to load in the header (on all pages):

<?php

session_start();
$url=”http://”.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$query = ‘source=’;
$string = strpos($url, $query);
if ($string === false){
//what should we do if we can’t find the query?
$source = ‘no value’;
$_SESSION['s_source'] = $source;
$s_source = $_SESSION['s_source'];
}else{
// we found the query – get the source value :)
$source = $_GET['source'];
$_SESSION['s_source'] = $source;
$s_source = $_SESSION['s_source'];
}

?>

#2. Append the Source value to the navigation.
This will pass the value from page to page.

*Note: if you have the navigation broken out of the main page – make sure you start the session on navigation.php  – set this line on the very first line (line 1). <?php session_start(); ?>

<ul id=”nav”>
<li><a href=”index.php<?php echo “?source=”.$s_source; ?>” id=”nav-discover”>Discover</a></li>
<li><a href=”sample.php<?php echo “?source=”.$s_source; ?>” id=”nav-sample”>Sample</a></li>
<li><a href=”downloads.php<?php echo “?source=”.$s_source; ?>” id=”nav-downloads”>Downloads</a></li>
<li><a href=”faq.php<?php echo “?source=”.$s_source; ?>” id=”nav-faq”>FAQ</a></li>
</ul>

#3 Send the value in an email.
Collecting the value and sending it in an email.

*Note: if you have the email code broken out of the main page – make sure you start the session on contact.php  – set this line on the very first line. <?php session_start(); ?>

//In the body of the email message.
Source = $s_source

//some clarification of the Source Values:
Source is where the user came from: email blast, banner ad, etc. If this value is blank the source value is missing from the url. If this value is ‘no value’, the user did not use the correct url (missing ?source=). Both of these scenarios can happen many ways. \n

Your url will now work like the following example:

http://jaschneider.com/sample_site/index.php?source=email

OR

http://jaschneider.com/sampel_site/?source=email

Source Value = email

If you see this error: “Cannot send session cookie – headers already sent”
I would check the charset.  I’ve fixed this error with this line:
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />

Analytic Reference

Terms:

Visits - a sequence of requests from a uniquely identified client that expired after a certain amount of inactivity, usually 30 minutes.

Absolute Unique Visitors – how many visitors (people) came to your site, counting each person only once for the entire time period being reviewed.

Example: Now, let’s say that I discover your site on Monday, January 5, 2009, and visit every weekday that week (once a day, always from the same computer, always from the same browser.) If I set my calendar to include the full week, GA sees five visits, one new visit, and one Absolute Unique Visitor. (The good part is coming.)

However, the web analyst could set his calendar to worry about only Wednesday, January 7 and Thursday, January 8. For those two days, we will see: two visits (one each day, right?), one unique visitor and NO new visits.

Why not? Remember that I discovered the website on Monday. When I visited on Monday, I was new. GA puts a cookie on my browser at that point, and every time I come back, I am considered a returning visitor.


Unique Views
– Unique Views are the equivalent of “Visits” to a single page. For example, if 1 person viewed a single page 100 times during the same visit, that page would show 100 pageviews, but only 1 “unique view”Pageviews – a request made to the web server for a page

Average Pageviews – The total number of page views divided by the total number of visits during the same timeframe.

Algorithm: Page Views / Visits = Average Page Views per Visit

Bounce Rate – When someone is at your site and bounces away to a different website
Example: I land on your website, glance at the information on the page then I decide to go to a different website.  However, if I had landed on your website, glanced at the information then clicked a link/tab on your website – then there is no bounce rate.

New Visits – people visiting the site for the first time ever!

Benchmark – Compares your website to other similar sites.  Either by size of website or by category.

Direct Trafficdoes include bookmark traffic and typed URLs, but these days (unless you are very strict about your campaign tracking parameters) it can and does include all kinds of other stuff. All it really means is that the session started without a referrer being passed by the user’s browser

Referring Sites – when a customer is on www.a.com and clicks on a link on www.a.com that links to your website. The link could be text, an image (banner ad) etc.

Search Engines – Google Analytics has a list of common search engines that it checks for.  Visitors that find grainglogix.com on yahoo.com for example will be put in the Search Engine section not referring sites.

Landing pages – The first page that a visitor sees.  This isn’t always the homepage.

Exit pages – The last page a visitor viewed before leaving your website.

 

Section Features:

Intelligence (Beta) – Currently not being used.  This section allows you to setup Google Analytics to email an alert when certain metrics are met.

Example: Email me (and others) when visitor traffic from Minneapolis is greater than 60 visitors per day.

Visitors – where information about each visitor is collected.  This section will tell you important information such as:

1)bounce rate (are people sticking around?)
2)visits (how many people are coming to our site?)
3)time on site (how long are people sticking around?)
4)browser capabilities (what are people using to visit our site?)
5)map overlay (where in the world are the visitors?)
6)benchmarking (how does our site measure up?)

Traffic Sources – gives details on how visitors found your website.  Some people will directly type in your URL (grainlogix.com), others will perform a search on google with a keyword.

Adwords, Ad Versions, and Campaigns are currently not setup for your site.  These are different features that could be enabled but require additional setup and sometimes a fee.  For example, Adwords is feature that Google offers where you can create paid ads on google.com

Content – collects data on where visitors are entering and exiting your site, and the most popular pages.  This section will help tell you where you may need to adjust the content.  For example if a product page is a top exit page, then we should review the page and visitor information to see why that page is a top exit page.  However, some pages in a website are considered exit pages.  Some exit pages might be, locations (Dealer/Rep locator) page, contact page, terms and conditions page.

This section also has In-Page Analytics.  This feature will bring up a page of your website and display how often each link is clicked.  This section can help with the layout and content of a site.

Site Search and Event Tracking are not being used at this time.  Current sites that have Analytics do not have internal search engines.  Event Tracking might be a feature we include to track how many times an informational PDF is downloaded from the site.

Goals – Generally this section would be used on an e-commerce site to track visitors through the check out process.  However, we can use this tool on non e-commerce sites.  Using this features means there is a “path” you want visitors to follow.  Without analytics, this couldn’t be done, but goals actually track the “path” and show you how many visitors completed path, how many didn’t complete the path and where did they go instead?

I have setup a sample of a Goal on this website. I would like to see a better Goal setup that would, for example, track how many visitors on the GL10 Truck Auger continue to the GL10 Accessories to the Dealer/Rep Locator (as there is a direct link on the GL10 Accessories to the Locator).  A Goal that is tracking a path only needs to have two pages but can have more.

Goals can also track Pages/Visit and Time On Site.

 

 

Beginning steps to setting up a company blog

Benefits of a Business Blog:

#1 Anybody in the company can contribute.  No Technical expertise needed to write the blog.
#2 Engage end users by encouraging them to leave comments.
#3 Fresh content will result in higher search engine results.

Writing a Business Blog tips:

Select a subject matter that will interest a specific audience (that may turn into customers).  Write to create relationships with the audience.  Provides a great opportunity for the blog to be keyword rich which  increases search engine results

Blog is a marketing toolkit to promote the company.

 Things to consider when starting a Business Blog:

i) What do you want to do with your Business Blog?
Make sure that you have a clear vision of what you want to do with your Business Blog are you using it as a customer service tool, as a marketing or branding method, to promote a particular product or service, as a market research or product development tool or any number of specific uses it is well suited to. Going through this process will ensure it has focus and will not become a jack of all trades and master of none – the more focused it is, the more successful it is likely to be.

ii) Who is your target audience for your Business Blog?
Avoid trying to make it be all things to all people it isnt possible. Once again focus is important, so decide on your target audience and write the blog for them with content they are looking for and a style that they will warm to. If you have lots of different groups that you wish to appeal to then you might be better off setting up separate blogs to cater for each of these specific areas.

iii) What results are you looking to achieve?
What goals do you have for your Business Blog and just as importantly, how are you going to measure them? There is going to be time and effort involved and you will be looking for specific results at the end of it – therefore, from the start, its good to know what results you are looking for. So decide on the criteria you want to work with and how you wish to measure them.

Following on from these, there are a number of other areas which are sensible to consider. Some are technical in nature while others relate to the running of the blog and its promotion.

iv) Look and Feel of the Blog
If you are using it as part of your website, then integrate the look and feel with that. Theres no need for your visitors to really know that they are on a blog – remember its the benefits that blogs offer that is important, not the technology. If it is on a separate domain, then design your Business Blog with the image you want to portray but dont use the default template that the blogging software provides. Why? Default template = zero differentiation!

v) How will it integrate with your other marketing activities?
Blogging is an excellent marketing tool, as well as having being strong in other areas. However, it is not a magic wand to cure all marketing ills, so it is necessary to decide how to best use it in conjunction with your other marketing, business development and customer service activities.

vi) Who will be blogging and how often?
If you are a small business or individual, then the decision about who will be blogging will be a straightforward one. For a larger organisation, the decision will depend on what the blog is focused on and hence who will be the best person to write with knowledge and passion about it. As for how often you should blog, frequency isnt as important as consistency so try to post regularly and keep your readers informed. As a caveat, however, you should be posting at least twice a week to give yourself the best chance of success.

vii) How to deal with comments?
Receiving comments on a blog is one of the more satisfying aspects of blogging because it shows that you have engaged your readers enough for them to want to comment. Some companies, however, view it with dread because of possible comments being aired which are not entirely positive. While I would always recommend being open to and responding to comments, the decision ultimately is in the hands of the blogger.

If you have thought through these elements, then you will be in a much stronger position to set up your blog and concentrate on writing the posts and building your readership with a strong base in place.

What is Version Control and Why is it useful?

Let’s first start this article with defining Version Control.

“The management of source code, documents, graphics and related files in a large software project.” – PC Magazine

What this means is that Version Control Software keeps tracks of all your files related to a project.  Version Control knows when picture.jpg or index.html has been modified, what was modified, and can retrieve previous versions for you.  This eliminates the need for people to have multiple copies of the same files and to try and keep track of the latest version and the previous versions.  Also, Version Control systems will alert users of “conflicts”.  A conflict can happen if two developers changed the same file and the same line number.  When this happens the “check in” or “commit” will stop and require user input to decide what to do with this conflict.

Types of Version Control Software:

There are many types of Version Control Software available.  Some are open source, others are proprietary, some are client-server model and other are distributed model.  How do you know which ones to pick?

So far my experience has been with Open Source versions such as CVS, SVN, and Git.  They all are a bit different but the overall operation is very similar.

CVS and SVN are client-server version control systems.  This means that the most current version of the project and it’s history is stored on the server. For more details go here: http://www.pushok.com/soft_svn_vscvs.php

Git is a distributed model of version control.  Information related to a project such as the current version, history, branches and tags are stored in a file structure. For more details go here: http://git-scm.com/about

This article has been written at a pretty high overview, but enough to at least let you know what version control is and that there are many different options.  Deciding which one is best for your all depends on your environment.

Drupal 7 + Drupal Commerce

Recently, I had an opportunity to build an E-Commerce Website.  After reviewing different platforms, I choose Drupal.  Being unaware on excatly how new Drupal 7 was, I charged ahead with the project.  Not long after I started this adventure I realized just how new Drupal 7 was.  This version of Drupal was released February 2011 and many modules hadn’t been converted over from Drupal 6 to Drupal 7.

I located a local Twin Cities Drupal + Ubercart/Commerce group that meet monthly.  I started attending these meetings and learned as much as I could about using Drupal and an e-commerce module.  After experimenting with both Ubercart and Drupal Commerce for Drupal 7, I decided to use Drupal Commerce to complete my project.  Drupal Commerce offered more documentation to use with the new platform and was a more stable release.  Drupal Commerce is also set to use PayPal WPS which is what was decided to use for this project.  Challenges arose later when the client wanted to add steps to the cart process.  Such as requiring name and phone numbers after a certain product/trip was added to the cart.  I managed to handle this request with Rules and WebForm but the solution was not very graceful.  We also discovered that Drupal Commerce doesn’t have a feature/module to add a specific dollar amount to the order total.  We could use the taxes module to add a percentage fee to the order total, so we managed to make that work.

Overall, I’m glad I finally got to work with a more advanced platform and I was more then thrilled with building my first E-Commerce Website.  I’ve learned a lot about Drupal 7 and Drupal Commerce and from this experience, I will be able to better advise future clients on what can be done with this combination and what (currently) can’t.

What is your experience with Drupal 7 and Commerce?

Adding a Tab to Facebook Business Page

To create a new tab on your Facebook Business page you have to install “Static FBML”.  To do this login to Facebook and in the FaceBook Search type Static FBML.  This will bring you to the Static FBML page and under the Logo image click a link that say “Add to my Page”.  You will then be asked to select the page you want to add it to (hint: you want to select your business page).

On your Business Page, under the logo, click Edit page.  On the left of the screen, select Applications.  You will now see the Static FBML application listed.  Click “Go to Application”.  This will take you to a simple page that has a Box Title and FBML box.

The Box Title is the name of the tab (“Welcome, Menu, Shop” or whatever you want).  In the FBML box you can use HTML or FBML.  For the work I’ve done with this application, I just used HTML. When you are done, click Save Changes and your tab should now be on your Business Page.

Note: You must be an Administrator of your Business Page to use this feature.
You can only use this application once for each Business Page.

Here is a helpful link: Click Here

“Practices of an Agile Developer” Review

Practices of an Agile Developer authored by Venkat Subramaniam and Andy Hunt; copyright 2006.

When the above book was suggested to me, I was less than thrilled. Jumping to the conclusion that this was going to be dry reading; I was more than surprised to say that I was completely wrong!

This isn’t your typical text book. Subramaniam and Hunt have written a great book that introduces what agile development is and how to implement it successfully. Introducing real life situations and how to respond in an agile way, gives the reader a way to connect with the concepts being delivered. This book keeps your attention by throwing in a little programmer humor, too.

Focusing on more than the way programmers should act, these authors shed light on the little devil inside us. Giving us responses that either we’ve done or know someone that has responded in a negative way. This book puts an immediate stop to the little devil inside us and explains the benefit of responding in agile and positive way.

At times, I felt the book touched on “duh” points like “Listening to Users” or “Keep it Simple”. Revisiting these basic concepts was a great reminder that from time to time I have found myself guilty of breaking these rules. Losing sight of these basics can put a cramp in your teamwork skills.

Other than hitting the basics, this book also touches on working with others, writing bug free code, and conducting quick and effect meetings. Giving you actual tips to perform at work and how to implement these tactics even if you’re not in a leadership role, is another great feature enclosed in this book. It’s not just theory.

After reading this book we started using Agile in our two person web development shop. I plan to follow this post up with others on how we are using agile and what is or isn’t working for us. I may be a beginner to agile development, but I can’t wait to encourage and show others how to effectively use this great tool.

I’ve been told this is one of those books every developer should read. Have you read it? What are your thoughts?

The Four Must Have WordPress Plugins

Have you been thinking about setting up your own WordPress site? Talking to other WordPress users, the general consensus is it’s easy!  All you do is install and start blogging. Well that is true but everyone who sets up a WordPress site should be familiar with plug-ins.

Plug-ins are what I call enhancements to WordPress. They are like extra tools to make your site better, custom and SEO friendly.  Only two plugins come with a standard installation and even these plugins can be removed if you don’t want or need them.  Plugins are completely up to you. In this blog entry I’m going to discuss the four “must have” plugins.

The first plugin I recommend is Askimet. This plugin comes standard with every WordPress installation. Askimet works to block spam comments on your blog. Activating this tool is pretty straight forward. In the plugins section, click Activate under Askimet. Then go HERE for your key (this does require you to signup).  Keys for Personal Blogs are free and non-personal keys are between $5-$15 per year. After submitting basic information for your type of blog an email is sent to you with the key.  Back in WordPress there will be a red box at the top t of the page asking for the key. Enter the information and you’re done. Your blog is now protected from spam comments.

The rest of the plugins I’m going to refer to do not come pre-installed on WordPress. You must find them and install them manually. Don’t worry this process is easier than it sounds.  There are two options for installing plugins.

1.       In the WordPress plugin page, there is a search for additional plugins box. Type in the name of the plugin you want, click search and select install on the plugin you were looking for.

2.       Outside of the WordPress admin console, locate and download the plugin you want. Then FTP the unzipped files to yoursite.com/web/content/wp-theme/plugins. Login to the WordPress Admin Console, navigate to the Plugins page and there is your plugin.

The Social Networking plugin that I recommend installing is AddToAny: Share/Bookmark/Email Button. This plugin adds a button to your blog posts that allows readers to share the posts on multiple Social Networking sites (like, twitter, facebook, etc) It’s a great way to let users help you get your blog noticed.

There are two SEO plugins that I would suggest to every blog user; Meta SEO and Google Sitemap Generator. Meta SEO helps you manage and add meta tags to your blog posts. After activating this plugin you’ll notice a new category in the left navigation of the WordPress Admin Console “Meta SEO”. This is where you manage your tags. To add tags to posts, either add a new post or edit an existing post. Scroll down beneath the content area of the post and you’ll see new features called Meta Keywords, Meta Tags, and Meta Descriptions, which is where specific post SEO information goes.

The other plugin, Google Sitemap Generator, does just that; it appends new posts information to an existing sitemap.xml and sitemap.xml.zip file. Before this plugin is activated, you need to create a blank sitemap.xml and a blank sitemap.xml.zip files to upload to your site. Place these files here: yoursite.com/web/content/. Activate the plugin and submit this xml file to Google Webmaster tools.

I have recommended four basic and very helpful plugins that every WordPress site should have; Askimet, AddToAny: Share/Bookmark/Email Button, Meta SEO, and Google Sitemap Generator. Although there are thousands of plugin out there, from my experience these four are the foundation to improving your blog.

Do you use any plugins similar to these? What are your core plugins?

Tips to managing a blog

Being someone who spends my days on a computer, I’m often asked about blogs.  How do I successfully engage end users? Why isn’t my blog ranked at the top of search engines? What’s the best way to advertise new content? Well, before we cover those questions, let’s backup a little.  Before we dive into blogs, we need a basic understanding of Search Engine Optimization (SEO).

Search Engine Optimization also known as SEO; sounds scary but there is nothing to be afraid of.  All SEO is a process of optimizing your content for search engines.  Keywords, organization, and linking all support the improvement of SEO. There are many ways to use SEO, but this topic requires its own blog post(s).

So, what does SEO have to do with writing a blog post?  Everything!  Every blog post requires a title but before you just type in a title, stop and think about it.  Having a blog title made up of common, everyday words will make the blog harder to find on search engines.  For example, if you’re looking for a blog about arranging wedding roses, you wouldn’t search for “arrange flowers”.  Instead you’d type in “Arrange wedding roses” which will produce more accurate results.  The second title specifies the type of flower and the type of arrangement. These are keywords.  Having keywords in the will help place the blog higher than blog posts without keywords in the title.

Now that we have keywords in the blog title, let’s cover the use of categories.  Blog categories were once explained to me as drawers in a file cabinet.  Each blog needs to be filed away and there are only so many drawers, so each drawer needs to cover a general topic.  The above simile uses the drawers as categories and the file cabinet is a website.  The main points to take away from the example is each blog needs to be assigned to a general category, there should be a limited number of categories, and categories help organize your posts.  So if you have a category labeled “Fitness” and I find one blog in this category I can easily navigate to the Fitness category to view the rest of the Fitness blogs.

Tags are a place to enter keywords that deal with the topic of the blog.  We can think of Tags as the folders in the file cabinet drawers.  These would be keywords that are (or wouldn’t fit) in the title.  Back to my Fitness Category; if I wanted to see more specifically blogs about Running, a tag would take me to that “file” with all Fitness blogs that deal with Running. When thinking of tags, it’s suggested to have a handful (or two) and reuse as the tags over and over again.  Having too many tags can overwhelm end users. How do you enter a tag? Most blogging sites follow this format: health,medical center,technology.  Where a comma separates the words and spaces are only allowed between phrases, like “medical center”.

Now that we’ve gone over how to organize your blogs, the next step forward is end-user interaction.  This section will cover comments, trackbacks, social networking, and RSS feeds.

Each blogger has their own opinion about enabling comments on blogs.  The purpose of comments is to allow readers to share knowledge, ask questions, and give their “two-cents” on the topic.  You might even get comments from readers requesting more blogs about the topic at hand. Without comments, it’s just your opinion/view out there.  No discussion, no feedback. Not having reader’s comments makes for a pretty lonely blog out there on the web.   Now, I do want to mention briefly that having comments enabled on your blog not only leaves the door open for readers to interact with the blog, it also can lead to some spam.  There are tools available to help alleviate spam and some bloggers just turn off comments on old blog posts.

Every now and again, you may write an excellent blog that completely inspires someone.  This end-user would like to write more than a comment; that’s where trackbacks come into use.  Trackbacks are a way of telling another blogger that you have found their post useful, and have made a post of your own which continues the discussion. This feature must be enabled on your blog site and enabled on the other person’s blog site to work.  When a reader uses a trackback that was set on your site, you will receive notification.  Now you can see what they wrote and post your comments.  You can look at trackbacks as a way to “link” common blog posts together and generate more conversation.

With the explosion of Social Networking websites, it is an excellent SEO strategy to use plugins on your blog site that enable readers to easily place a link to your blog on their social networking site (facebook, twitter, linkedin, etc.)  This is the electronic “word of mouth” advertising that every successful blog uses.  Using this feature as a plugin, takes little time to setup and can be one of the best features on your blog.

Living in the hustle and bustle of everyday life, Many people don’t always have time to sit down to go through all the of the blog sites they want to.  This is where RSS (Real Simple Syndication) feeds come to the rescue.

Every blog should have an RSS feed URL.  This allows potential subscribers to use an RSS Reader, which requires this URL.  A RSS reader aggregates all of the end user’s favorite blogs and RSS feeds into one central location; allowing the user to simply check the RSS reader to view the latest updates from their selected blogs and RSS feeds.  A RSS reader can be a stand-alone desktop application like NewsGator or many homepages like Google allow you to add widgets that will serve as an RSS reader.

*** Suggested Tip: Use Google’s Feedbuner to publicize your RSS feed.  The advantage of Feedburner is it allows you to change where your blog is hosted without changing the RSS feed URL that viewers have subscribed to. Subscribers that are linked to RSS feed’s that are run through Feedburner won’t even notice that your blog location has changed which prevents loosing subscribers.  If you move your blog without Feedburner, then users will have to re-subscribe to your RSS feed which can lead to loosing subscribers.  For more information on what feedburner can do check out their help section.

In conclusion, successful blogs harness Search Engine Optimization which leads to more readers.  Keeping your blog organized and encouraging viewers to interact with your blog are the fundamental steps to building something great. There have been many steps covered here and I hope every topic gives you a better understanding on how each part builds to the next part.

Do you have any experience with blogging? If you have, what has helped you? If you haven’t, did this article help get you started?

MS SQL and MySQL Database Backups on Rackspace Cloud

Recently, I was asked to setup an automatic database backup process for some cloud sites.  Not having much experience with database backup, let alone setting up an automatic process.  I plowed ahead on the project.

I was directed to this link for the MS SQL Databases: http://cloudsites.rackspacecloud.com/index.php/How_can_I_create_a_cron_job_to_backup_my_MSSQL_database%3F

Following the above link was more than helpful.  Although, I still ran into an error after running through the directions.  “curl: (6) Couldn’t resolve host ‘backupdb.asp’ ”  My first mistake was, I was using the linux path instead of the windows unc path in the backup.asp file.  My second mistake was I didn’t enter a full url for the command to run in the cron job setup.  After fixing those simple mishaps, I now have an automatic backup running for my sites.

For MySQL Databases, I was directed to this site: http://cloudsites.rackspacecloud.com/index.php/How_do_I_create_a_cron_job_to_backup_my_MySQL_database%3F

I can’t say that I’m at all familiar with shell scripting or that I even know what the code is really doing.  For the MySQL Database process I did wonder off the directed path and had found another backup tool, phpMyBackupPro (http://www.phpmybackuppro.net/).  This tool can be easily installed on your site and will create an automatic backup for you.  Using this tool for multiple sites isn’t what it was designed for, unless you want to install this tool on each site.  No thank you.

After that little adventure, I got back on my directed path.  The error I found this time was “No such file or directory”.  After reviewing the shell script multiple times, I couldn’t find anything wrong.  I did some searching and found this:

#!/bin/bash
Backupdir= *******.com/backups
backupfile=`date +backup-%d-%m-%y_%H.sql`
tarfile=mysqlbackup.tar
cd $backupdir
mysqldump –opt -A -h ******** –password=****** -u ******* > $backupfile
gunzip “$tarfile”.gz
tar rf $tarfile $backupfile &> /dev/null
gzip $tarfile
rm $backupfile

*replace the “*” with actual information

I plugged in the information for the script then continued setting up the cron job per the original directions in the above link.  The first time this script runs, you will get a “File Not Found”.  Run the script a second time and the error is gone.  I’m now getting automatic backups of my MySQL Databases.

WordPress Themes