Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 16 to 30 of 33
  1. #16
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jun 2004
    Posts
    313
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    Not sure why this script is needed when cPanel has a fully-functional full backup via FTP right in the WHM interface?
    NDCHost (ProVPS): Xen VPS / Dedicated / Co-Location
    Contact us for your cPanel Licensing needs! We price match, provide better support, and take care of our customers!

  2. #17
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    I do understand the purpose of the original thread, since the original poster only had cPanel access to the machine where automatic backups aren't possible for the end-user to perform. Not certain for the newer script that uses the API and backs up all the accounts on the machine, though.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #18
    Member
    Join Date
    Feb 2008
    Location
    Atlanta, GA
    Posts
    77
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    You cannot use the incremental backup option in conjunction with ftp backups through WHM. That is the point of the script-you can have normal incremental backups in WHM and use the script to backup all accounts to another server.
    Also in our setup we want to have backups local and remote.
    Last edited by tomdchi; 06-24-2011 at 12:58 AM.

  4. #19
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jun 2004
    Posts
    313
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    I suppose the script would make sense for incremental and full backs in conjunction, but for local and remote it would be significantly more efficient to just have a postcpbackup hook to copy a local backup via FTP/SCP to the remote storage point.
    NDCHost (ProVPS): Xen VPS / Dedicated / Co-Location
    Contact us for your cPanel Licensing needs! We price match, provide better support, and take care of our customers!

  5. #20
    Member
    Join Date
    Aug 2010
    Location
    Christchurch, New Zealand
    Posts
    11
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    One thing that would be nice, is for hosts that use whmcs for their billing systems, to be able to offer some kind of backup solution through there, I have been hunting high and low for one.

    Quite a few users are not that technically up to being able to log into cPanel and create a full backup from there.

    Any thoughts as to how that could be done maybe? Some kind of simple click here to generate Backup and email them a download link to get the files perhaps?

  6. #21
    Member
    Join Date
    Nov 2009
    Posts
    7

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    Well the updated script mentioned here doesnt work for me.

  7. #22
    Member
    Join Date
    Nov 2009
    Posts
    7

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    I get this error:

    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/backup/fullbackup.php on line 74

  8. #23
    Member
    Join Date
    Nov 2009
    Posts
    7

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    Fixed it. Now I get this:

    Warning: fsockopen(): unable to connect to dhruvahosting.com:2082 (Connection timed out) in /home/backup/fullbackup.php on line 44 Failed to open socket connection… Bailing out!

  9. #24
    Registered User
    Join Date
    Jul 2011
    Posts
    1

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    Hi everyone. I bought a reseller package so I could host lots of sites and offer hosting etc. I cpanel automated weekly back up would be very useful indeed - I have a home NAS server that all the files could be backed up to... Is this what this script offers and if so how to you actually install it and get it to work. Does it create an option in cPanel to make the settings or do you have to some how run it? Sorry I'm a little naive to all of this...

    I'm maily a graphic designer, but I'd hate to lose my clients work from not having a daily or weekly back up in place.

    Any help much appreciated. Thanks.

  10. #25
    Member
    Join Date
    Oct 2010
    Posts
    14

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    Quote Originally Posted by MikeHigginbotto View Post
    Correct. The code as written will backup two sites. You can add more sites by adding extra entries to the array like so:

    $sites['2']['domaintobackup'] = "example.com";
    $sites['2']['cpaneluser'] = "user2";
    $sites['2']['cpanelpass'] = "pass2";
    $sites['2']['cpanelskin'] = "x3Bronze";

    and so on.
    I went to your site, but could not find the script just a link to the original code.

    Glad to see people working on a solution for this issue.
    Cut Above Host
    http://www.cutabovehost.com/
    High Performance • Enterprise Servers • Premium Network

  11. #26
    Member
    Join Date
    Jan 2004
    Location
    Austria
    Posts
    35

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    What is the advantage of this script over the built in whm backup feature ?

    (I am talking about WHM >> Backup >> Configure Backup)

  12. #27
    Registered User
    Join Date
    Oct 2011
    Posts
    1
    cPanel/Enkompass Access Level

    Website Owner

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    I used to have the same problem with manual backups and searching for backup tools I found MySQLBackupFTP (/http://mysqlbackupftp.com). This tool has a free version that allows you to compress your backup files, ftp to a remote server and send email notification. You can also connect to MySQL through phpMyAdmin, doing this you work directly with the tool using its friendly GUI. You can give this tool a try if you don't want to backup your databases manually using scripts.

  13. #28
    Member
    Join Date
    Jan 2004
    Location
    Austria
    Posts
    35

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    I do not see any script that does better than the whm/cpanel feature
    Main >> Backup >> Configure Backup

    - it does automatic daily/weekly backup to a remote ftp site (even if it is at your home)

    - it does backup to a location on your whm/cpanel server, from where you can - for added safety and saving bandwidth - rsync the resulting backup files by cron job to a remote location using ssh. All can be setup without need of personal interaction.

    enable secret key root login on your whm/cpanel server (anyway a good idea), install private and public keys on your backup server in /root/.ssh that your backup server can access the whm/cpanel server without need to manually send a root password

    setup a root's cronjob, on the backup server e.g.
    10 10 * * * /bin/sh /root/rsync.sh

    rsync as root - (put a Shellscript nammed e.g. rsync.sh on yout backup server) containing:
    rsync -avz -e 'ssh -i /root/.ssh/rsync' --delete-after root@1.2.3.4:/yourcpanelbackupdir/ /yourremotebackupdir/

    live happy ...

  14. #29
    Registered User
    Join Date
    Mar 2012
    Posts
    4
    cPanel/Enkompass Access Level

    Reseller Owner

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    Quote Originally Posted by zombo View Post
    I do not see any script that does better than the whm/cpanel feature
    Main >> Backup >> Configure Backup

    - it does automatic daily/weekly backup to a remote ftp site (even if it is at your home)

    - it does backup to a location on your whm/cpanel server, from where you can - for added safety and saving bandwidth - rsync the resulting backup files by cron job to a remote location using ssh. All can be setup without need of personal interaction.

    enable secret key root login on your whm/cpanel server (anyway a good idea), install private and public keys on your backup server in /root/.ssh that your backup server can access the whm/cpanel server without need to manually send a root password

    setup a root's cronjob, on the backup server e.g.
    10 10 * * * /bin/sh /root/rsync.sh

    rsync as root - (put a Shellscript nammed e.g. rsync.sh on yout backup server) containing:
    rsync -avz -e 'ssh -i /root/.ssh/rsync' --delete-after root@1.2.3.4:/yourcpanelbackupdir/ /yourremotebackupdir/

    live happy ...
    this thread dead already? im new bies here wanna asking something regarding this issues.
    is possible me as the reseller (just own the WHM account) to do this? i have no control with the server. it seem not found where to put and edit those data like above. i just can do cron job but need the script. so above script cannot be applied as i dont know how to do. any one please assist me?

    * as i have tons of account like 50 account but need to backup it manually it all. type 1 by 1 is really make me dying. someone, please assist me please.

  15. #30
    Registered User
    Join Date
    Mar 2012
    Posts
    4
    cPanel/Enkompass Access Level

    Reseller Owner

    Default Re: Automatic cPanel backup (domain & MySQL) with cron & PHP

    Quote Originally Posted by tomdchi View Post
    This is the script I use to backup accounts to another server.
    Requires xmlapi-php available at https://github.com/CpanelInc/xmlapi-php
    This will:
    Backup ALL accounts on the server.
    Use API to get list of accounts.

    Note that the argument in the code below "\\" is the destination ftp directory.


    PHP Code:
    <?php
    require ('xmlapi.php');

    class 
    cpbackup
    {
        public function 
    backup($source_server_ip$server_password$ftp_domain$ftp_acct$ftp_pass$notify_email)
        {
            
    $xmlapi = new xmlapi($source_server_ip);
            
    $xmlapi->password_auth("root"$server_password);
            
    $xmlapi->set_port('2087');
            
    //$xmlapi->set_debug(1);//this setting will put output into the error log in the directory that you are calling script from 
            
    $xmlapi->set_output('array');
            
    $userlist $xmlapi->listaccts();
            foreach (
    $userlist as $v => $field)
            {
                foreach (
    $field as $cpuser)
                {
                    if (!empty(
    $cpuser['user']))
                    {
                        
    $cpanel_account $cpuser['user'];
                        
    $api_args = array('ftp'$ftp_domain$ftp_acct$ftp_pass$notify_email21"\\");
                        
    $response $xmlapi->api1_query($cpanel_account'Fileman''fullbackup'$api_args);
                        foreach (
    $response as $v2)
                        {
                            
    $result $v2['result'];
                        }
                        if (
    $result == 1)
                        {
                            
    sleep(60);
                        }
                    }
                }
            }
            return 
    true;
        }
    }

    $backup = new cpbackup();
    $result $backup->backup('server ip''server root password''ftp domain''ftp acct''ftp pass''notify email address');


    ?>

    Tom
    anyone done this before??

Similar Threads & Tags
Similar threads

  1. Exim & PHP & Domains & Ip's & /etc/mailips
    By NemoXP in forum E-mail Discussions
    Replies: 2
    Last Post: 05-13-2010, 12:37 AM
  2. Exim & PHP & Domains & Ip's & /etc/mailips
    By NemoXP in forum New User Questions
    Replies: 0
    Last Post: 05-12-2010, 08:41 AM
  3. Replies: 2
    Last Post: 07-04-2007, 08:12 AM
  4. Replies: 12
    Last Post: 08-16-2006, 10:56 PM
  5. Mysql 4 & php & horde problem
    By vincento in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-10-2003, 07:52 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube