Page 1 of 2 12 LastLast
Results 1 to 15 of 24

Thread: Backup Availability

  1. #1
    Join Date
    Jun 2004
    Posts
    58

    Backup Availability

    It appears that backup comes with all idologic plans, however I haven't been able to find many details, so please update my bullet points below that I've tried to generate for you. Please modify, if varied from cpanel and DirectAdmin.

    Manual Backups:
    - At our own schedule-login and select backup options
    - This storage space is or is not included in our drive space.

    idologic:
    - Backups generated every night at XXX GMT
    - Format is a mirrored directory or TAR file??
    - etc. etc...

    Sorry if I've overlooked this information elsewhere...

  2. #2
    Join Date
    Feb 2003
    Posts
    3,667
    All plans do come with backups, but for liability reasons we cannot guarantee the integrity of them, however, here's the setup:

    For cPanel and DA:
    - daily backups to a 3rd drive or straight to the (remote) backup server
    - backups are archives on weekly/monthly rotation on the remote server

    For cPanel and DA:
    - RAID-1 drives for redundancy

    DA:
    - allows for automated backups remotely or in your backup space. These do count towards your quota, the backups made by us do not count towards your quota.
    - backups are in DA's own format.

    cPanel:
    - allows for manual backups remotely or in your backup space. These do count towards your quota, the backups made by us do not count towards your quota.
    - backups are in cPanel's own format.

    backups include public_html, your mail and databases. Mailing lists are also taken care of.

    DA & cPanel also backup all major system files required for a restore.

    Thanks!

  3. #3
    Join Date
    Jul 2004
    Posts
    140

    Automated Cpanel Backups

    DH,

    I hope you don't mind me adding my own two cents.

    I use cpanel and I have taken advantage of some scripts that others have written to automated cpanel backups onto my local machine. I have customized them for my purposes and to ensure that they do not put a load on the servers.

    Basically, a cron job runs a php script that runs the cpanel backup. Cpanel has an option to dump the file to a remote FTP server so I use this functionality.

    If you are a little bit familar with PHP & cron it is not very hard to setup.

  4. #4
    Join Date
    Jun 2004
    Posts
    58
    Quote Originally Posted by xlink
    Basically, a cron job runs a php script that runs the cpanel backup. Cpanel has an option to dump the file to a remote FTP server so I use this functionality.
    Could you please hook us up with this fantastic script as a TXT file since it appears the forum won't acceept PHP? =)
    I was getting ready to set something like this up. Andriven I believe even has a rotating script that he has used.

    Thanks for the info!

  5. #5
    Join Date
    Jul 2004
    Posts
    140
    Brett,

    I sure can. I actually have two different versions of the script, let me know which one you would like.

    The first one is the simplest, it doesn't require a DB. All the config info you need is put in the script itself. You just keep one copy of this file for every domain you want to backup and then you schedule them individually with cron.

    The second script requires more advanced knowledge to setup. All of the information about what domains you backup is kept in a myssql db and you use phpmyadmin to add/remove records from the db.

    Let me know which one you want and I will get it to you.

  6. #6
    Join Date
    Jun 2004
    Posts
    58
    Cool, the first simple one is a must, however the more advanced might be worth looking into as well. Decisions! Pretty much the same with just modified configuration in tables, eh? Cool. If it looks clean and works well, perhaps I'll check in with the DB one? Or you could just zip a directory and upload for all. =)

    thx!

  7. #7
    Join Date
    Jul 2004
    Posts
    140
    Ill try to get to this later this week.

    I have to remove my info and clean up the files a bit first.

  8. #8
    Join Date
    Jul 2004
    Posts
    140
    Here we go.. my super duper backup scripts. I wish I could take credit for these but I picked them up on forum somewhere and just modified them for my purposes.

    This first post will talk about the single file version and the next post will deal with the database version.

    The script:
    Code:
    <?php 
    
    // PHP script to allow periodic cPanel backups automatically. 
    // Based on script posted by max.hedroom in cpanel.net forums 
    //   This script contains passwords.  KEEP ACCESS TO THIS FILE SECURE! 
    // Never store this in public_html, keep it above this directory.
    
    // ********* THE FOLLOWING ITEMS NEED TO BE CONFIGURED ********* 
    
    // Info required for cPanel access 
    $cpuser = ""; // Username used to login to CPanel 
    $cppass = ""; // Password used to login to CPanel or the Reseller password
    $domain = ""; // Domain name where CPanel is run 
    $skin = "bluelagoon"; // Set to cPanel skin you use (script won't work if it doesn't match) 
    
    // Info required for FTP host test
    $ftpuser = ""; // Username for FTP account on the remote machine
    $ftppass = ""; // Password for FTP account on the remote machine
    $ftphost = ""; //ftp IP or address 
    $ftpmode = "ftp"; // FTP mode ("ftp" for active, "passiveftp" for passive) 
    
    // Notification information 
    $notifyemail = ""; // Email address to send results 
    
    // Secure or non-secure mode 
    $secure = 0; // Set to 1 for SSL (requires SSL support), otherwise will use standard HTTP 
    
    // Set to 1 to have web page result appear in your cron log 
    $debug = 0 ; 
    
    // *********** NO CONFIGURATION ITEMS BELOW THIS LINE ********* 
    
    if ($secure) { 
        $url = "ssl://".$domain; 
        $port = 2083; 
    } else { 
        $url = $domain; 
        $port = 2082; 
    } 
    
    $socket = fsockopen($url,$port); 
    if (!$socket) { echo "Failed to open socket connection... Bailing out!\n"; exit; } 
    
    // Encode authentication string 
    $authstr = $cpuser.":".$cppass; 
    $pass = base64_encode($authstr); 
    
    $params = "dest=$ftpmode&email=$notifyemail&server=$ftphost&user=$ftpuser&pass=$ftppass&submit=Generate Backup"; 
    
    // Make POST to cPanel 
    fputs($socket,"POST /frontend/".$skin."/backup/dofullbackup.html?".$params." HTTP/1.0\r\n"); 
    fputs($socket,"Host: $domain\r\n"); 
    fputs($socket,"Authorization: Basic $pass\r\n"); 
    fputs($socket,"Connection: Close\r\n"); 
    fputs($socket,"\r\n"); 
    
    // Grab response even if we don't do anything with it. 
    while (!feof($socket)) { 
        $response = fgets($socket,4096); 
        if ($debug) echo $response; 
    } 
    
    fclose($socket); 
    
    ?>
    Modify this script with your ftp info, and the domain info and place it somewhere within your home directory.
    For example, in /home/your_account/backup/backup.php.

    Then setup a cron job like so:
    Code:
    00 4 * * * php /home/your_account/backup/backup.php >/dev/null
    This will run the script every day at 4am.

    What I do is make a copy of backu.php for each domain I want to backup and then call them seperatetly at different times in the cron.

    Its probably a good idea to run them at odd times like 4:02, 4:17am etc to keep the load down on the server.

    That's it, pretty simple!

  9. #9
    Join Date
    Jul 2004
    Posts
    140

    Backup of multiple domains through a DB driven script

    First, you need to create a database in Cpanel. Then use PHPMyadmin (SQL Tab) to create a table. Just copy and paste this text into the SQL query window to create the db.
    Code:
    -- phpMyAdmin SQL Dump
    -- version 2.6.1-rc1
    -- http://www.phpmyadmin.net
    -- 
    -- Host: localhost
    -- Generation Time: Mar 30, 2005 at 07:01 PM
    -- Server version: 4.0.22
    -- PHP Version: 4.3.10
    -- 
    -- 
    
    -- --------------------------------------------------------
    
    -- 
    -- Table structure for table `cpanel_backups`
    -- 
    
    CREATE TABLE `cpanel_backups` (
      `domain` char(50) NOT NULL default '',
      `cpuser` char(20) NOT NULL default '',
      `cppass` char(20) NOT NULL default '',
      `skin` char(20) NOT NULL default '',
      `ftpuser` char(20) NOT NULL default '',
      `ftppass` char(20) NOT NULL default '',
      `notifyemail` char(30) NOT NULL default '',
      `backup` char(3) NOT NULL default 'yes'
    ) TYPE=MyISAM;
    Once the database has been created, you can use the "Insert" tab in PHPMyadmin to add a record for each domain you want to backup.

    Next you need to create the php file, I will use dbbackup.php:
    Code:
    <?php 
    
    /* Set this to your MySQL Information */
    
    
    $sql = array(
    "user" => "", // The username for mysql
    "pass" => "", // The password for mysql
    "host" => "localhost", // Host
    "db" => "" // Your database name - don't forget its usernme_dbname format
    );
    $link=mysql_connect($sql[host],$sql[user],$sql[pass]);
    mysql_select_db($sql[db]);
    
    $find_backup_domains=mysql_query("SELECT * FROM cpanel_backups WHERE backup='yes'");
    while($backup_domain=mysql_fetch_array($find_backup_domains))
    {
    // Info required for cPanel access 
    $cpuser = "$backup_domain[cpuser]"; // Username used to login to CPanel 
    $cppass = "$backup_domain[cppass]"; // Password used to login to CPanel 
    $domain = "$backup_domain[domain]"; // Domain name where CPanel is run 
    $skin = "$backup_domain[skin]"; // Set to cPanel skin you use (script won't work if it doesn't match) 
    
    // Info required for FTP host 
    $ftpuser = "$backup_domain[ftpuser]"; // Username for FTP account 
    $ftppass = "$backup_domain[ftppass]"; // Password for FTP account 
    $ftphost = "";  // Full hostname or IP address for FTP host 
    //$ftphost = "ftp.$backup_domain[domain]"; // Full hostname or IP address for FTP host 
    $ftpmode = "ftp"; // FTP mode ("ftp" for active, "passiveftp" for passive) 
    
    // Notification information 
    $notifyemail = "$backup_domain[notifyemail]"; // Email address to send results 
    
    // Secure or non-secure mode 
    $secure = 0; // Set to 1 for SSL (requires SSL support), otherwise will use standard HTTP 
    
    // Set to 1 to have web page result appear in your cron log 
    $debug = 0; 
    
    // *********** NO CONFIGURATION ITEMS BELOW THIS LINE ********* 
    echo "Domain: $domain \n";
    if ($secure) { 
    $url = "ssl://".$domain; 
    $port = 2083; 
    } else { 
    $url = $domain; 
    $port = 2082; 
    } 
    
    $socket = fsockopen($url,$port); 
    if (!$socket) { echo "Failed to open socket connection... Bailing out!\n"; exit; } 
    
    // Encode authentication string 
    $authstr = $cpuser.":".$cppass; 
    $pass = base64_encode($authstr); 
    
    //$params = "dest=homedir&email=$notifyemail&submit=Generate Backup"; 
    $params = "dest=$ftpmode&email=$notifyemail&server=$ftphost&user=$ftpuser&pass=$ftppass&submit=Generate Backup"; 
    
    // Make POST to cPanel 
    fputs($socket,"POST /frontend/".$skin."/backup/dofullbackup.html?".$params." HTTP/1.0\r\n"); 
    fputs($socket,"Host: $domain\r\n"); 
    fputs($socket,"Authorization: Basic $pass\r\n"); 
    fputs($socket,"Connection: Close\r\n"); 
    fputs($socket,"\r\n"); 
    
    // Grab response even if we don't do anything with it. 
    while (!feof($socket)) { 
    $response = fgets($socket,4096); 
    if ($debug) echo $response; 
    } 
    
    fclose($socket); 
    // Wait 5 minutes before continuing to not overload server
    // echo "Domain $domain completed.. Sleeping 15 minutes!\n";  // For testing you can uncomment this line.
    sleep (1500);
    }
    
    ?>
    You will need to modify the db info to match your db connection settings as well as add your IP or domain name for the destination of the ftp backups.
    Place this file above public_html. For example, somewhere like:
    Code:
    /home/your_account/backup/dbbackup.php
    This script will pause 15 minutes between backups to ensure the server is not overloaded. If you have particularly large sites (over 100-200mb) you may want to increase this delay. Just modify the sleep(1500) line to the number of seconds you need to wait.


    Lastly, you need to create a cron job to call this one script.
    Code:
    00 4 * * * php /home/your_account/backup/dbbackup.php >/dev/null
    Again, this will run at 4am, you can change this to whatever suits your needs.


    I would be very open to any sugestions or comments. Again, I didn't write these scripts, I just found them and modified them for my purpose.

  10. #10
    Join Date
    Feb 2003
    Posts
    3,667
    very cool scripts. hadn't seen those myself

  11. #11
    Join Date
    Jul 2004
    Posts
    140
    Glad you liked them. I think I may have found them on the cpanel forums originally but to be honnest I am not sure.

    I have used them for a few months now and I have not yet had any problems once they are properly configured.

  12. #12
    Join Date
    Mar 2006
    Posts
    14
    is it possible to modify script somehow to do incremental backup?

  13. #13
    Join Date
    Jul 2004
    Posts
    140
    The script simply calls the built in cpanel backup script. I have not seen any options in cpanel to do an incremental backup, therefore I am pretty sure it is not possible.

  14. #14
    Join Date
    Mar 2006
    Posts
    14
    is there any other program for incremental backup of complete website?

    i'm going to buy a reseller packet soon, so I'm doing a research now

  15. #15
    Join Date
    Feb 2003
    Posts
    3,667
    Rsync works well

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

-->