Get Paid to Participate     Twitter     Facebook     Google+
Hosting Discussion
 

forgot password?


Reply


Old
  Post #1 (permalink)   07-26-2004, 08:27 AM
HD Master
 
Join Date: Feb 2004
Posts: 348

Status: RobAPI is offline
Hello
Could anyone tell me where I can get a script to backup everything on my server please?
I am running cPanel and I don't think the cPanel backup does everything, I would like to have it so if anything happens on my server I can have it restored to exactly how it was before.
This is just for a personal server and I would like all settings to be saved somewhere incase something does happen.

Thanks
__________________
Robert
 
 
 


Old
  Post #2 (permalink)   07-26-2004, 08:34 AM
HD Master
 
Join Date: Nov 2003
Location: Chicago, IL
Posts: 400
Send a message via ICQ to imported_maxhest Send a message via AIM to imported_maxhest Send a message via Yahoo to imported_maxhest

Status: imported_maxhest is offline
Hmm, I only use Ensim Pro and that seems to be working well with automatic backups.. I wouldn't know cPanel backups..
__________________
Max
www.moon-hosting.com
Premium Linux Hosting :tux:
A MoonInteractive Company
 
 
 


Old
  Post #3 (permalink)   07-26-2004, 10:24 AM
HD Master
 
Join Date: Feb 2004
Posts: 348

Status: RobAPI is offline
Don't mean the actual cpanel backup, that is automatic but it only backups up some things, databases, account files and email.
But I would like something that backs up the config of the server itself so I can have it back to normal if anything ever does happen.
__________________
Robert
 
 
 


Old
  Post #4 (permalink)   07-28-2004, 08:18 PM
HD Addict
 
fallcreek's Avatar
 
Join Date: Jun 2004
Location: Indianapolis, IN
Posts: 103

Status: fallcreek is offline
Robapi,


Here is a script that will allow you to automate your cpanel backup through cron jobs.


Be aware though that this script is a potential security hole because you are passing your login and password information in the clear through an http connection.


ABSOLUTELY keep this script out of your public_html directory.

Code:
// 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!

// ********* THE FOLLOWING ITEMS NEED TO BE CONFIGURED *********

// Info required for cPanel access
$cpuser = "username"; // Username used to login to CPanel
$cppass = "password"; // Password used to login to CPanel
$domain = "example.com"; // Domain name where CPanel is run
$skin = "x"; // Set to cPanel skin you use (script won't work if it doesn't match)

// Info required for FTP host
$ftpuser = "ftpusername"; // Username for FTP account
$ftppass = "ftppassword"; // Password for FTP account
$ftphost = "ftp.example.com"; // Full hostname or IP address for FTP host
$ftpmode = "ftp"; // FTP mode ("ftp" for active, "passiveftp" for passive)

// Notification information
$notifyemail = "you@example.com"; // 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);

?>
Remember to put the file with this code in your "home" directroy - not in "public_html".
And CHMOD it 600.
Then create the cron job, like this;

5 2 * * 6 /usr/local/bin/php /home/username/fullbackup.php
(=2.05 am saturday)
__________________
http://www.fallcreektech.com
http://www.mediabuynet.com - My lovely wife's site.
 
 
 


Old
  Post #5 (permalink)   07-29-2004, 06:28 AM
HD Guru
 
Join Date: Oct 2003
Location: Michigan, USA
Posts: 553

Status: Vovex Technology is offline
RobAPI you should take a look at LiquidWeb's backup servers. They provide you some space / bw and a cool little script which you can use from your own home to remote into both locations and do either full/partial backups. It is kind of pricey.... but an offsite backup is a very good idea.

You could always pay an extra $15 a month to get a 40GB drive installed as a slave. Then write a cronjob that will copy from one drive to the other.
__________________
Jonathan
 
 
 


Old
  Post #6 (permalink)   07-31-2004, 10:35 AM
HD Master
 
Join Date: Feb 2004
Posts: 348

Status: RobAPI is offline
Hey,
Thanks for that fallcreek (Is it John you are called?) but it looks like it only uses the full backup for cPanel and doesn't backup any of the server config.
I am able to do a backup from cPanel to a remote server or another hard disk, but I would also like the server config backed up and the config for all scripts and services installed and running.

I have never seen anything for this and not sure if it exists but I am just after something that will backup everything needed to do a full restore on the server if anything serious was to ever go wrong, so nothing at all would be lost.
Kind of like what a system restore would do on Windows now that I think about it..
__________________
Robert
 
 
 


Old
  Post #7 (permalink)   07-31-2004, 11:29 AM
Unregistered
 
Posts: n/a

Status:
Sorry about that, RobAPI,

Now that I look back over your messages, I see that I misunderstood your request.

You're right, this just automates the cPanel backup.

Try going to cpanel.net, the forums there usually have quite a lot of information on backups.

John
 
 
 
Reply

Thread Tools

New Post New Post   Old Post Old Post
Posting Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Sponsored By: