Automated Joomla website backups will protect against accidental loss of data
As mentioned in other articles, backing up your website is one of the most important things you need to consider when developing and deploying your website. This article gives some details on how to automate Joomla backups using the XCloner backup component.XCloner component, now we'll give some detailed instructions on how to setup an automated backup solution using this component.
First of all you obviously need to install the component, we're assuming here that you know how to do this, and you've already installed the component.
Go to the settings and ensure that the settings have been adjusted to suit your needs. Once you have configured the component click on the Generate Backup tab, and click on Continue to ensure that your backups are working correctly.
Once you know that backups are working fine, we now come to automate these jobs. In XCloner, this is done via a cron job. If you don't know what cron means, don't worry. A very small explanantion of what cron is:
cron is a time-based scheduling service in Unix/Linux computer operating systems. What this essentially means is that you schedule jobs on your webserver. The job we will be scheduling is the automated Joomla backup.
There are two ways to do this
- The techie way - this is the way that one would the job if you really know exactly what you are doing, what cron are exactly, how to create them via your cpanel or whatever your host runs on. We are assuming that most of you do not fall under this category, otherwise you wouldn't be here
- The Joomla newbie way - this is the way Joomla users who want to create an automated backup job do it. These are users who need to be able to create a cron job, without actually having a clue what a cron job is.
Create a Cron job which automates your backup
The creators of XCloner have realised that most people using Joomla fall under the second category, they want an easy way of creating an automated Joomla backup. Telling them to create a cron job is not very helpful. Thus, they have come with another small component called JCron. JCron allows you to create cron jobs, without having to go through all the dirty details... Therefore your next step is to download and install JCron.
Once JCron has been installed, you need to configure it, but thankfully this only requires a few clicks. Go to the JCron Configuration area and make sure that the Cron run is enabled. You can enter your email address to send logs to. Once the cron job has been enabled, you need to set the actual schedule and backup job. Go to JCron > Manage Cron Jobs
- Give your cronjob a name eg. 'Daily Backup' - simple enough
- Choose 'Web Address' as Task Type - this is because we are not going to run an SSH command. We will be running a file available with the default XCloner install which contains a specification for a cron job.
- Enter the url to the cloner.cron.php file - this file is already available in your XCloner installation. Make sure you change the URL to the correct path of your website (eg. http://www.yoursitenamehere.com/administrator/components/com_cloner/cloner.cron.php)
- For a daily backup you need to select these options:
- Minutes - Run at 0 - this means it will run exactly on the hour. You can choose to run the job at other minute settings such as at 30 past an hour, every minute, every 5 minutes, etc ...
- Hours - 3 = 3 AM - this means it will run at 3AM (your server's time. You can choose to run at any hour you prefer, though you should choose the time when you anticipate least traffic, such that any performance hit during the backup will not affect a lot of users.
- Days - Every day. You can also decide to run at a specific day in the month, though we recommend running at least a daily backup
- Months - Every month. By now I hope you have gotten the gist of how this works ...
- Weekdays - Every weekday
- Dont pay attention to the 'UNIX Crontab' setting
- Save your job
- Publish your job
Wait for the specified time, and go to View your Backups. If you have setup everything correctly you should find a joomla backup. To check that everything is working correctly and not having to wait for a day, I recommend setting the Minute setting to every 5 minutes to check. Once you have confirmed that it is working, you can activate it to run once in a particular hour.
And that is the way to create an automated Joomla backup. For further security, I recommend you ftp the backup file to a different server on a different host, so that in case of a calamity, you can have a backup of your website stored safely on a separate server.
If you like this article, please spread the word