Results 1 to 25 of 27
-
04-20-2004, 11:00 PM #1Web Hosting Master
- Join Date
- Feb 2004
- Posts
- 1,827
Taking backup of a reseller account!
Hi!
Is there any way that reseller can take a complete backup of all sites hosted in the reseller account through WHM?
Also is it possible to auto set FTP backup as while having root access to WHM?Last edited by morehost; 04-20-2004 at 11:04 PM.
Wholesale Domain Prices for Retail Customers - Rushtoweb.com
-
04-20-2004, 11:40 PM #2Web Hosting Master
- Join Date
- Aug 2002
- Posts
- 645
No, there is not a way for a reseller to perform a backup of all sites under a reseller account via WHM (though that would be a nice feature).
And no, there is not a way (at least that I know of) to set an FTP backup via WHM.
-
04-21-2004, 12:25 AM #3Web Hosting Master
- Join Date
- Feb 2004
- Posts
- 1,827
Thanks Erik,
And isn't there any method that reseller can backup his and his clients site together.. any additional script or any workaround etc?Wholesale Domain Prices for Retail Customers - Rushtoweb.com
-
04-21-2004, 12:34 AM #4Web Hosting Master
- Join Date
- Aug 2002
- Posts
- 645
Not a formal way anyway. You should post this in the cpanel forums as a feature request. The only negative side to this would be a gzip of that size would bog a server down for a good 5-20 minutes depending on the size of the reseller account (therefore I dont know how far it would go). You could do it the old fashioned way and log into everyones account and download a backup from the control panel. A little messy, but it gets the job done.
-
04-21-2004, 06:48 AM #5Workaholic
- Join Date
- Jan 2004
- Location
- New York, NY
- Posts
- 1,241
domainwala, your host can backup all of your sites - including your clients sites for you. (If they offer that option.)
-
04-21-2004, 07:01 AM #6Web Hosting Master
- Join Date
- May 2003
- Location
- Heartland, USA
- Posts
- 733
Here's a script I "hacked" up from various snippets I found here and there... It works for me! It executes the WHM/cPanel Full Backup for each account under a Reseller Account, and the Reseller Account too, if desired. It will also FTP each site's backup to a remote server, if so configured. Hope it works for you!
Code:<?php /* Based on original code by dv at josheli.com What it does: It will backup all accounts under a cPanel Reseller Account How it works: Reads all accounts (domain and username specifically) from the listaccts page in WHM Calls the dofullbackup.html routine of cpanel for each account, using the account's username and the reseller's password Creates filenames like "bkup_mydomain_com_11_11_03.tar.gz" in account's home directory Saves the backup file to an ftp destination if specified Caveats: This script doesn't require cron, but can be executed from one. Instructions: 1. Modify "config" variables below, to suit 2. From the command prompt: >cd /path/to/backupScript >php backup_reseller.php 3. ([Or] Optionally) Set up a cron job to call this script */ /*** BEGIN CONFIG ***/ // Reseller Domain (e.g. myDomain.com), UserID and Password $whmDomain = 'yourDomain.com'; //your reseller domain $whmUser = 'yourResellerID'; //your web host manager user name $whmPass = 'yourResellerPwd'; //your web host manager password // Destination; Same as offered within cPanel; Choose your poison... // $dest = 'homedir'; //Home Directory $dest = 'ftp'; //Remote FTP Server // $dest = 'passiveftp'; //Remove FTP Server (Passive mode transfer) // Email to send completion notification eMail $email = 'you@yourDomain.com'; // Remote Server (FTP/SCP only) $server = 'yourFTPServer.com'; // Remote User (FTP/SCP only) $user = 'yourFTPLogonId'; // Remote Password (FTP/SCP only) $pass = 'yourFTPPwd'; // Be kind to your kindred... Take a nap! $sleep = 60; // How many seconds to pause between each account // BackUp the Reseller Domain too? $bkupReseller = true; // Set to 'true' to backup the reseller's account, // 'false' to skip the reseller's account /*** END CONFIG ***/ set_time_limit(0); echo ">> Reseller Full Backup <<\n"; // Base64 Encode Reseller UserID & Password $authstr = "$whmUser:$whmPass"; $whmUidPass = base64_encode($authstr); // Get the WHM 'list accounts' page $socket = fsockopen($whmDomain,2086,$errno,$errstr); if (!$socket) { echo "fSocket Error to WHM: $errstr ($errno)<br />\n"; die(); } else { fputs($socket,"GET /scripts2/listaccts?viewall=1\r\n"); fputs($socket,"HTTPS/1.0\r\n"); fputs($socket,"Host: $whmDomain\r\n"); fputs($socket,"Authorization: Basic $whmUidPass \r\n"); fputs($socket,"Connection: close\r\n\r\n"); $page = ''; while (!feof($socket)) { $page .= fgets($socket,4096); } fclose($socket); } // Get each account's table row $int2 = preg_match_all("/<tr class=(?:tdshade2|tdshade1)>(.*?)<\/tr>/is", $page, $matches); if($int2 > 0 && is_array($matches[1])) { foreach($matches[1] as $match) { $account = explode('</td><td>',$match); $account[0] = strip_tags(trim($account[0])); //domain $account[2] = strip_tags(trim($account[2])); //username // Base64 Encode Account UserID w/ Reseller Password $authstr = "$account[2]:$whmPass"; $cPanelUidPass = base64_encode($authstr); // Kick off the cPanel Backup for the Account... $socket = fsockopen($account[0],2082,$errno,$errstr); if (!$socket) { echo "fSocket Error: $errstr ($errno)\n"; } else { echo "Processing client account: $account[0] \n"; fputs($socket,"GET /frontend/x/backup/dofullbackup.html?dest=$dest&email=$email&server=$server&user=$user&pass=$pass\r\n"); fputs($socket,"HTTPS/1.0\r\n"); fputs($socket,"Host: $account[0] \r\n"); fputs($socket,"Authorization: Basic $cPanelUidPass \r\n"); fputs($socket,"Connection: close\r\n\r\n"); while (!feof($socket)) { fgets($socket,4096); } fclose($socket); } sleep($sleep); } } // Now do yourself if desired... if($bkupReseller){ // Kick off the cPanel Backup for the Reseller Account... $socket = fsockopen($whmDomain,2082,$errno,$errstr); if (!$socket) { echo "fSocket Error: $errstr ($errno)\n"; } else { echo "Processing reseller account: $whmDomain \n"; fputs($socket,"GET /frontend/x/backup/dofullbackup.html?dest=$dest&email=$email&server=$server&user=$user&pass=$pass\r\n"); fputs($socket,"HTTPS/1.0\r\n"); fputs($socket,"Host: $whmDomain \r\n"); fputs($socket,"Authorization: Basic $whmUidPass \r\n"); fputs($socket,"Connection: close\r\n\r\n"); while (!feof($socket)) { fgets($socket,4096); } fclose($socket); } } echo ">> Le Fini <<\n\n"; ?>
You've got to accentuate the positive; Eliminate the negative
Latch on to the affirmative; Don't mess with Mister In-Between
-Bob
-
04-21-2004, 08:13 AM #7Aspiring Evangelist
- Join Date
- Mar 2003
- Posts
- 389
will try that later - if it works, superb!!!!!
thanks a lot.
ryan
-
04-21-2004, 08:24 AM #8Junior Guru
- Join Date
- Oct 2003
- Posts
- 231
That's a very nice script you have there, I like the listaccts part and may resue it in a similar project if you agree (with credit)
There are two problems with this line:
Code:<?php fputs($socket,"GET /frontend/x/backup/dofullbackup.html?dest=$dest&email=$email&server=$server&user=$user&pass=$pass\r\n");
2- The FTP feature is cPanel's FTP feature, and it doesn't work in PASSIVE mode, making it impossible to upload to a FTP server behing a router (like your home PC on a cable modem with a router).
I had a lot of trouble trying to get around problem #2 and still got no results.
I am currently planning to write a backup procedure from scratch, something that would use system function like gzip etc to backup, and NOT rely on cPanel's backup.
I already promised Ryan I'd write this script, but still did not find time to fiddle around with this stuff. And now that I'm on HIS server, i want to be extra careful whith what I'm doing
Alex
-
04-22-2004, 01:40 AM #9Web Hosting Master
- Join Date
- Feb 2004
- Posts
- 1,827
Thanks for the great script, I am testing it...
Wholesale Domain Prices for Retail Customers - Rushtoweb.com
-
05-11-2004, 12:50 AM #10Newbie
- Join Date
- Sep 2001
- Location
- New York
- Posts
- 19
This script is A.W.E.S.O.M.E. It works perfectly for me. Two thumbs up!
However, there's a bug in cpanel itself - at full backups, cpanel actually does NOT backup mySql databases. Anyone knows how to get around this (other than logging into each domain and backup manually)?
Or would that be possible for a seperate script to backup ONLY mySql? Thanks!
-
05-11-2004, 03:23 AM #11Aspiring Evangelist
- Join Date
- Mar 2003
- Posts
- 389
Originally posted by alex-info
I am currently planning to write a backup procedure from scratch, something that would use system function like gzip etc to backup, and NOT rely on cPanel's backup.
I already promised Ryan I'd write this script, but still did not find time to fiddle around with this stuff. And now that I'm on HIS server, i want to be extra careful whith what I'm doing
Alex
Just thought I would say incase anyone is still after a script
Ry
-
05-11-2004, 01:12 PM #12Newbie
- Join Date
- Aug 2003
- Posts
- 17
I would be interested in Alex's new script, especially if it solves the MySql problem that CPanel has with full backup. How can I get a copy?
-
05-11-2004, 01:58 PM #13Junior Guru
- Join Date
- Oct 2003
- Posts
- 231
Robnelli, my script is not 100% complete but the actual version could be considered as a beta and is 100% working. With it you can backup directories and mysql databases, you have to specify (in a config file) what you want to backup.
If you would be interested in trying this script I would really welcome you as a beta tester, the scripts works great for me and rchosts (Ryan) too .. so I'm pretty sure it would work for you too
Contact me at the email adress: alex [@] alex-info.net
I'll email you the script (very simple to install and configure). If things work out for you, I'll give you a free copy as a thank you for you beta-testing.
You need the IonCube loader installed on your server since the script is protected using IonCube, but most hosts already have the IonCube loader installed, so that shouldn't be a problem.
For the others, FYI the script is a simple backup script, you specify a list pf directories and databases to backup, the script does the backups (via a web interface or a CRON job) and can store them on the server or FTP them to a remote PC.
I coded the script because none of the scripts I found were able to upload to my home PC behind a firewall (problems with passive mode) but this one works great it uploads my backups right here every night.
To restore a mysql backup you can use PhpMyAdmin and upload the backup file. To restore a directory backup you need SSH access to untar and ungzip the file. A restore option may come in a later release.
-
05-14-2004, 01:21 PM #14Junior Guru
- Join Date
- Oct 2003
- Posts
- 231
Rob & Overhosted, I sent you the email with download and install instructions. Thanks for your interest in my script !
-
05-14-2004, 10:18 PM #15Junior Guru Wannabe
- Join Date
- Nov 2003
- Location
- Kissimmee, FL
- Posts
- 57
I'm not so sure that it would be a good thing if the resellers could setup automatic backup of their accounts. I'm sure such a feature would drive the server load way up when several backups are being performed, and that would be a definite problem for the server admins.
-
05-14-2004, 10:21 PM #16Junior Guru Wannabe
- Join Date
- Nov 2003
- Location
- Kissimmee, FL
- Posts
- 57
Re: Taking backup of a reseller account!
Originally posted by domainwala
Also is it possible to auto set FTP backup as while having root access to WHM?
-
05-14-2004, 10:30 PM #17Web Hosting Master
- Join Date
- Feb 2004
- Posts
- 1,827
Re: Re: Taking backup of a reseller account!
Originally posted by gimme5
I forgot to add: yes, if you have root access, you can setup FTP backup with WHM. (daily, weekly, monthly...)Wholesale Domain Prices for Retail Customers - Rushtoweb.com
-
05-14-2004, 10:37 PM #18Junior Guru Wannabe
- Join Date
- Nov 2003
- Location
- Kissimmee, FL
- Posts
- 57
oh, ok, sorry, I misunderstood
-
05-15-2004, 12:35 AM #19Web Hosting Master
- Join Date
- Nov 2001
- Location
- Singapore
- Posts
- 769
Alex, this would be a great script if it works. I'm looking for something like that myself as well!
My question is - how will the restore work? Does it keep all WHM information intact as well so when I restore, it will restore all my WHM settings including account information?
-
05-15-2004, 01:19 AM #20Web Hosting Master
- Join Date
- Feb 2004
- Posts
- 1,827
And dns files too?? Could that be backed up and restored?
Wholesale Domain Prices for Retail Customers - Rushtoweb.com
-
09-23-2005, 02:41 AM #21New Member
- Join Date
- Sep 2005
- Posts
- 4
why would rrdega's script stop working all of a sudden?..
-
09-24-2005, 05:35 PM #22New Member
- Join Date
- Sep 2005
- Posts
- 4
help on this please
-
09-24-2005, 07:24 PM #23Disabled
- Join Date
- Sep 2005
- Location
- Southern California
- Posts
- 114
I don't have much experience with cpanel, but I know in other control panels they have features where you can create backups on the admin/reseller and user level. A good example of this type of control panel would be DA. Good luck with the script if it works for you.
-
09-25-2005, 02:46 AM #24New Member
- Join Date
- Sep 2005
- Posts
- 4
thanks for the reply, yeah the script was working and now only does my main reseller account?..
I know i can access the other accounts with admin password but so much hassle. are there any other scripts out there to do this task? even if i have to buy it.
cheers
-
09-25-2005, 08:16 AM #25Eternal Member
- Join Date
- Dec 2004
- Location
- New York, NY
- Posts
- 10,710
Perhaps the latest cPanel version (that some hosts may have upgraded to) has some changes in the structure?
- GsvMediaLayer, LLC - www.medialayer.com Learn how we can make your website load faster, translating to better conversion rates for your business!
The pioneers of optimized web hosting, featuring LiteSpeed Web Server & SSD Storage - Celebrating 10 Years in Business