Made to Order Software Corporation Logo

MO Backup: mo_backup.module File Reference

Module functions of the backup module. More...

Enumerations

enum  MO_BACKUP_VERSION
 

Define the version of the MO Backup module.

More...

Functions

 mo_backup_perm ()
 Check for the list of permissions used in this module.

 mo_backup_help ($section)
 Display different help messages.

 mo_backup_menu ()
 Menu to edit the MO Backup settings.

 mo_backup_form_settings_submit ($form, &$form_state)
 The submit function for the global settings.

 mo_backup_cron ()
 Run a backup of this website.

 mo_backup_run ()
 Run the backup from the Settings screen.


Detailed Description

The mo_backup module is used to backup a website files and database.

The usefulness comes from the fact that the final result is then sent to another computer using an HTTPS POST. Code for the clients is provided in mo_backup/mo_backup.php

The log in (username) and password need to be transform in a valid URL. You may want to use the following PHP instruction to get the full URL to add to the MO Backup settings area:

echo 'https://' . urlencode('my log in name') . . urlencode('top-secreut & complicated [Password]') . '@m2osw.com';

In general, spaces are transformed to a + character and any non-ASCII character as well as all the special URL characters are transformed to %<char> value.

The files folder and the settings files are saved in a tarball. The database is backed up using pg_dump. The result is then compressed and kept on the server. It is then sent to one or more HTTPS servers.

The POST includes the following parameters:

  • Username
  • Password
  • Date for this backup
  • Backup number (incremented by one each time a backup is done)
  • Name of the file being sent (domain name + backup number + .tar.gz)
  • The actual backup file

The module requires you to have tar, gzip, and use PostgreSQL as your database system.

Copyright (c) 2009-2011 Made to Order Software Corp.

http://www.m2osw.com/mo_backup contact@m2osw.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Enumeration Type Documentation

This variable defines the version of the MO Backup module. This will always be the same as the version defined in Drupal (throught the .info file.)


Function Documentation

mo_backup_cron ( )

This function runs whenever CRON wakes up. It runs the necessary commands to backup the website.

References _mo_backup_run().

mo_backup_form_settings_submit ( form,
&$  form_state 
)

This function saves in the database the values defined in the settings form.

Parameters:
[in]$formThe form being submitted
[in,out]$form_stateThe current state of the form
mo_backup_help ( section)

Implementation of hook_help().

Parameters:
[in]$sectionThe section that requests a help message.
Returns:
A string with the help.
mo_backup_menu ( )

This function returns an array of menu items.

mo_backup_perm ( )

Implementation of hook_perm().

Only the administrator has access to the backup settings by default. You need to edit the permissions to authorize other users to tweak the settings.

Returns:
An array of permissions.
mo_backup_run ( )

This function runs the backup functions as someone clicks on the "Backup now" button found in the settings form.

References _mo_backup_run().

Documentation generated by Doxygen on Sun Apr 8 2012 20:30:03