Every website should have a regular backup that has been tested to proove that it is working, so when something goes wrong you can simply restore the files or data.
One of the most popular Joomla extensions is Akeeba Backup, which I personally use on every Joomla website I create. This software not only does an excellent job at backing up your Joomla site, but it also has the ability to automate this backup, so you really have no excuse for not backing up your site. Both the free version and the professional version have the ability to schedule a regular front end backup using a cron job, which is what I'm going to demonstrate in this blog.
The first step to configure your automatic backup, it to click on options and enable the front end backup.
Click on the Front-end backup tab, select yes for the enable front-end and remote backup, and enter a secret word. The secret word can be any combination of letters and numbers, and is used to prevent other people triggering your site backup, because without this a hacker could potentially break your site by running multiple backups until your hosting account ran out of disk space.
Save and close this, and now open up your CPanel provided by your web host. Most good web hosts have a "Cron jobs" section, and this is where we can schedule the automatic backup.
The frequency of your backup is really dependant on your site, for a basic site that doesn't update very often you should at least do a monthly backup. Some sites you may want to back up weekly, whereas others may require daily backups. If in doubt, I recommend a weekly backup. Now this is the confusing bit, as cron jobs can be a bit complex, but in this case I'm going to go the easy option and just select a daily backup (once a day) from the common settings menu, which fills out the minute, hour, day, month and weekday boxes automatically.
In the command box is where we copy and paste our cron job, in this case using SiteGround web host the command:
curl -b /tmp/cookies.txt -c /tmp/cookies.txt -L --max-redirs 1000 -v "http://www.yourwebsite.com/index.php?option=com_akeeba&view=backup&key=SD09k7VcW6pz"
Where www.yourwebsite.com is the url of your website, and SD09k7VcW6pz is the secret word you typed into your Akeeba Backup options.
For web hosts that don't support curl, you can see some alternate cron commands in the Akeeba Backup documentation.
Now if everything went well, you should see a "Frontend" backup appearing on your site each day.
While automating your backup is a good idea, I also recommend that your backup be stored separately from your website. An easy way to do this is with the Akeeba Backup Professional version, where you can configure your backup to store the files on a Cloud based file storage such as Amazon S3, Dropbox, Google Storage, and many others.