fbpx
Call us +1-231-421-7160

Creating Cron Jobs from an SSH Terminal

A Cron Job is a feature that allows you to create a task that you would like it to run automatically on your Joomla Instance through the server. Through a Cron Job, you can specify exactly what you'd like to accomplish. You can, for example, send a weekly email newsletter on Sunday mornings at 9 a.m. to all of your clients. You create the command through the Cron Job and the server will do the work automatically. You can even ask the server to send you email notification that the Cron Job was completed. This article explains how to create a Cron Job from an SSH terminal and how to set up a command to receive a confirmation email. There are also related resources at the end of this article to help you learn more.

Creating a Cron Job

First, open the Terminal (if using Linux) or Putty (if using Windows).

Next, login with your SSH username & password that we sent to you.

You should see something like the following:

-sh-4.1$

Now type "crontab -e" after that command:

 -sh-4.1$crontab -e

This will open a file for you where you will be able to add the Cron Job you would like to run.

Click  “A” on your keyboard and you will enter the edit mode so you can enter your command.

Your command should look something like following:

* * * * * curl http://yourdomainname/something/component_something.php
 

If you would like to add your email to receive notification every time your Cron Job runs to keep for your record or ensure the Cron Job went through correctly, you can add this command:

MAILTO=youremail

Keep in mind that if you are running a Cron Job every 5 minutes and you have enabled email notification, you will receive a notification email every 5 minutes which may be an inconvenience.

After you are done, click “ESC” to quit end the edit mode. 

Next, type in ":wq" to write and quit.

The resources below will help you understand how to create your Cron Job and what each of the stars mean.

Back to Top

Related Resources

Crontab - Quick Reference

Do you have suggestions for improving this article?  

We take a great deal of pride in our knowledgebase and making sure that our content is complete, accurate and useable. If you have a suggestion for improving anything in this content, please let us know by filling out this form. Be sure to include the link to the article that you'd like to see improved. Thank you!