PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Ovidiu Lesei   Cpanel cURL Backup   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example of use
Class: Cpanel cURL Backup
Take backups of cPanel based hosting accounts
Author: By
Last change:
Date: 13 years ago
Size: 1,001 bytes
 

Contents

Class file image Download
<?php
   
//Warning: This script contains passwords. KEEP ACCESS TO THIS FILE SECURE! (place it in your home dir)

    //################# Usage Example ###################
   
require_once "cpanel.backup.class.php";
   
   
$CpanelObject = new CpanelBackup();
   
   
//CPanel Username
   
$CpanelObject->cpanel_user = "cpanel_user";
   
   
//CPanel Password
   
$CpanelObject->cpanel_pass = "cpanel_password";

   
//CPanel Domain Name
   
$CpanelObject->domain = "miledino.ro";
   
   
//CPanel backup Home dir set it to TRUE if you wanna backup the home dir of the site
   
$CpanelObject->home_dir_backup = TRUE;
   
   
//Set the name of the databases
   
$database[]="database_name_1";
   
$database[]="database_name_2";
   
$CpanelObject->databases = $database;
   
   
//Store locations of the backup files. Make sure that you have permission
   
$CpanelObject->backup_store_location = "C:\\backups\\";
   
   
//Log in to cpanel
   
$CpanelObject->cpanel_login();
   
   
//Execute backup
   
$CpanelObject->save_cpanel_backup();
?>