Home
Have you visited the Joomla! Extension Directory lately? We're there too!
Note: Do not post support questions in our listing, post them in our forum where you will receive better attention.
Performing front-end backups PDF Print E-mail
Written by Nicholas K. Dionysopoulos   
Saturday, 08 November 2008 18:58

Performing front-end backups

The Frontend backup function is intended to provide the capability to perform an unattended, timed backup of your site.

The script performs one backup step and sends an HTTP 302 header to force the client to advance to the next page, which performs the next step and so forth. You will only see a message upon completion, should it be successful or not. There are a few limitations, though:

  • It is NOT designed to be run from a normal web browser, but from an unattended cron script, utilizing wget or cron as a means of accessing the function.

  • The script is not capable of showing progress messages.

  • Normal web browsers tend to be "impatient". If a web page returns a bunch of 302 headers pointing to itself, the web browser thinks that the web server has had some sort of malfunction and stop bothering with the page. It might also show some kind of "destination unreachable" message. Remember, these browsers are meant to be used on web pages which are supposed to show some content to a human. This behaviour is normal. Most browsers will quit after they encounter the twentieth page redirect response, which is bound to happen if you use the Slow algorithm or have a large web site.

  • Command line utilities will give up on a page after it has been redirected a number of times. For example, wget gives up after 20 redirects, curl after 50 redirects. Since JoomlaPack redirects once for every step, it is advisable to configure your command line utility with a large number of redirects; I believe 1000 will do for 99,9% of sites.

Most hosts offer a CPanel of some kind. There has to be a section for something like "CRON Jobs", "scheduled tasks" and the like. The help screen in there describes how to set up a scheduled job. One missing part for you would be the command to issue. Simply putting the URL in there is not going to work. If you are on a UNIX-style OS host (usually, a Linux host) you most probably have access to a command line utility called wget. It's almost trivial to use:

wget --max-redirect=1000 "http://www.yoursite.com/index2.php?option=com_joomlapack&

view=backup&key=YourSecretKey&format=raw"

Of course, the line breaks are included for formatting clarity only. You should not have a line break in your command line!

[Important]Important

Do not miss the --max-redirect=1000 part of the wget command! If you fail to include it, the backup will not work with wget complaining that the maximum number of redirections has been reached. This is normal behavior, it is not a bug.

[Warning]Warning

Do not forget the double quotation marks which surround the URL. Otherwise the ampersands and other special characters will be interpreted by your shell and cause the backup to fail.

If you're unsure, check with your host. Sometimes you have to get from them the full path to wget in order for CRON to work, thus turning the above command line to something like:

/usr/bin/wget --max-redirect=1000 "http://www.yoursite.com/index2.php?option=com_joomlapack&

view=backup&key=YourSecretKey&format=raw"

Contact your host; they usually have a nifty help page for all this stuff.

Optionaly, you can also include an extra parameter to the above URL, &id=profile_id, where profile_id is the numeric ID of the profile you want to use for the backup. If you don't specify this parameter, the default backup profile (ID=1) will be used. In this sense, the aforementioned URL becomes:

/usr/bin/wget --max-redirect=1000 "http://www.yoursite.com/index2.php?option=com_joomlapack&

view=backup&key=YourSecretKey&format=raw&profile=profile_id"

wget is multi-platform command line utility program which is not included with all operating systems. If your system does not include the wget command, it can be downloaded at this address: http://wget.addictivecode.org/FrequentlyAskedQuestions#download. The wget homepage is here: http://www.gnu.org/software/wget/wget.html. Please note that the option --max-redirect is available on wget version 1.11 and above. At the time of this writing this particular version was not available for the Windows ™operating system.

[Important]Important

Using a web browser (Internet Explorer, Firefox, ...) or wget version 1.10 and earlier will most probably result into an error message concerning the maximum redirections limit being exceeded. This is not a bug. Most network software will stop dealing with a web site after it has redirected the request more than 20 times. This is a safety feature to avoid consuming network resources on misconfigured web sites which have entered an infinite redirection loop. JoomlaPack uses redirections creatively, to force the continuation of the backup process without the need for client-side scripting. It is possible, depending on site size, JoomlaPack configuration and server setup, that it will exceed the limit of 20 redirections while performing a backup operation.

Last Updated ( Saturday, 08 November 2008 18:59 )
 
Copyright (C) JoomlaPack. All Rights Reserved.
JoomlaPack is proudly hosted by Rochen Ltd.