Currently set to No Index

Using cPanel to Setup Cron Jobs

The “cron job” is one of the basic programming tools that remind you that you can get a lot of function out of learning just a little code.  A “cron job” is simply a command that you instruct your server to perform at regular intervals.  It can literally be any command that you can run normally.

You have the power!

Not only are the advantages of this obvious, but once you realize the power you can get from this in just a few commands, much of what you use control panels for may start to seem frivolous.  You can, for example, in just a single command backup an entire directory once a week and email it to yourself.  Don’t be scared: we are diving a bit into expert stuff here, but only to prove the point.  You can do a lot with very little.

RELATED:   Control Panel Industry Overview – 4 Top Competitors

So how do you do it?

Even by cPanel standards this is one of the easier functions to perform. Scroll down in your cPanel home page.  You’ll probably find “Cron Jobs” in the Advanced section. Click on it and you’ll be asked whether you like it easy or hard.  Personal preferences aside, there’s not much reason to go hard. Click on “Standard” to get to the main cron jobs screen.

cron jobs cpanel

You will first enter the email address that the results of the cron job will be sent: if it is not successful, the email will contain the error message, though this may require some debugging on your part.  Next you will enter the command.  One unavoidable technical note: the command must be typed in using the full path.  So if you are running a script that is in your home directory, you must specify the full server path to it.

RELATED:   How to Install osCommerce and Activate SSL Through cPanel

Get your timing right

Now you need to specify how often you want the cron job to run.  Most of this is self-explanatory, though there is at least one potentially confusing item.  You can specify the days that the job will run both by days of the month and days of the week.  That’s not confusing by itself, but what happens if you choose both?  Let’s look at the combinations.

  • “Days” = “Every Day” and “Week Days” = “Every Week Day”: This will run the cron job on every single day.
  • “Days” = “2” and “Week Days” = “Every Week Day”: This will run the job on the 2nd day of the month only.
  • “Days” = “Every Day” and “Week Days” = “Tuesday”: This will run the job on every Tuesday.
  • “Days” = “2” and “Week Days” = “Tuesday”: This will run the job on the 2nd Tuesday of the month only.
RELATED:   Popular Free Control Panels - No Charge, Great Value

That’s it!

Now hit “Save Crontab” and you’re done!  You can then go back to this later and delete or modify the job.  Note that you can also create mulitple cron jobs, even if they use the same commands.  You might want to, say, backup a certain directory every day, and your entire account every month.

Now the only thing you need to do is learn the commands you want to run.  This should make clear that this is worth the effort.  Cron jobs are one of the most useful basic tools for just about any developer, and cPanel makes using them even easier.

How to Find a Successful Name For Your New Blog?
How to Find a Successful Name For Your New Blog?

One of the most important decisions you can make to ensure your blog is among the best is to select a name. While there are more than 500 million blogs available...

How-to Start a Blog – Review of the Best 10 Blogging Platforms
How-to Start a Blog – Review of the Best 10 Blogging Platforms

If you want to start a blog as fast as possible, then you need to consider choosing a blogging platform. Thankfully, there are some excellent free and paid blogging platforms...

How Referral Marketing Can Benefit Web Hosts
How Referral Marketing Can Benefit Web Hosts

Even if the niche of web hosts are fully loaded with a lot of companies they are still one of the easiest to promote because you could write your own...

Broken Links: How to Find, Fix, and Benefit from Broken Links
Broken Links: How to Find, Fix, and Benefit from Broken Links

Links are what holds the web together. Essentially, the web is named as such because of the ability for pages and sites to link to other sources and relevant information....

Brand Value & the Most Powerful Brands (with Infographic)
Brand Value & the Most Powerful Brands (with Infographic)

Brand value – everyone wants it, however, only few are able to achieve it. The subject of “brand value” holds a significant position amongst marketers, executives, and entrepreneurs. Let’s discuss...

Reasons why your business should shift to Cloud hosting
Reasons why your business should shift to Cloud hosting

Cloud hosting has been on the rise since its inception. The improvement to your website performance and business efficiency that comes with Cloud hosting is almost tangible.

Why We Love the IT Support Career?
Why We Love the IT Support Career?

In almost all of my posts I was talking about the stressful side of the IT – the long hours, end user issues, migrations, midnight calls and the like. But...

IT Manager: Ways To Show Your Appreciation To Your Team
IT Manager: Ways To Show Your Appreciation To Your Team

Surely your team struggled hard and made things happen. You cannot say “this is what you get paid for” and just leave – you cannot keep your IT staff that...

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *