PHP Classes

File: backup.php

Recommend this page to a friend!
  Classes of Oscar Dias   PHP Ubuntu One Backup   backup.php   Download  
File: backup.php
Role: Example script
Content type: text/plain
Description: Example of how to use the class
Class: PHP Ubuntu One Backup
Send MySQL database backup files to Ubuntu One
Author: By
Last change: Update of backup.php
Date: 4 months ago
Size: 1,409 bytes
 

Contents

Class file image Download
<?php
/*
u1backup v1.1.2
Copyright (C) 2013 Oscar de Souza Dias

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

require 'u1backup.php';

// Instantiate and execute
$u1obj = new u1Backup();

// Settings
// Define database connection
$u1obj->setDatabase('localhost', 'root', '', 'dbname');
// or $u1obj->setDatabase('localhost', 'root', '', array('dbname1','dbname2')); // Multiple databases

// Define folders for backup
$u1obj->setFolder('/var/www');
// or $u1obj->setFolder(array('/var/www/site1', '/var/www/site2')); // Multiple folders

// Local path for files (must have permission) and Ubuntu One path
$u1obj->setWorkFolders('/tmp/', '/~/Ubuntu One/backups');

// Your credentials for Ubuntu One
$u1obj->setUbuntuOne('email', 'pass');

// Execute
$u1obj->execute();