icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Discussions » All Things Techy » Site Maintenance » Reliable script for database backups?

Site Maintenance Program updates, securing your website, creating backups.

Reply
 
LinkBack Thread Tools Search this Thread
Old January 22nd, 2007, 1:24 PM   #10 (permalink)
Registered User
Comfy Contributor
 
carnuke's Avatar
 
Joined in Apr 2004
Lives in UK
114 posts
Gave thanks: 5
Thanked 0 times
I passed this script to support via a ticket to ask them to check it out and verify its security. Still waiting to hear back from them. It's important we get a script that not only works, but is secure and acceptable to the admins, or else they will simply ban it.

Ill let you know as soon as I get an answer.
__________________
Thanks SURPASS for all your help and support...
Richard [A xoops user and documentation writer for xoops.org. ]
Website: HouseofStrauss.co.uk Server: Nifty (xx.xxx.238.158)
carnuke is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 22nd, 2007, 2:46 PM   #11 (permalink)
Registered User
Excelling Contributor
 
Joined in Feb 2005
544 posts
Gave thanks: 88
Thanked 24 times
I was finally able to test the script. It's pretty good for one account only. But for resellers that want to back up all their clients db, the best thing is still a simple cron job:

Code:
curl http://clientusername@clientpassword@domain.com:2082/getsqlbackup/db-name.gz --output /home/reseller-username/backup-directory/db-name.gz
Run this from your main reseller account to back up your client's databases. The downside is that you need one cron job for each db, but it's no biggie. I've been using this for months and works like a charm.
__________________
Patty

Pass 57 | Dime999 | SH 110

Last edited by Patty; January 22nd, 2007 at 2:48 PM..
Patty is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks Patty for this great post!
mgk (April 18th, 2007)
Old January 22nd, 2007, 2:55 PM   #12 (permalink)
Registered User
Comfy Contributor
 
carnuke's Avatar
 
Joined in Apr 2004
Lives in UK
114 posts
Gave thanks: 5
Thanked 0 times
Quote:
Originally Posted by Patty View Post
I was finally able to test the script. It's pretty good for one account only.
Patty, how did you setup the script to work? originally you had problems with the paths I think. Thanks for that line for the resellers backups. Yep, look a good option.
__________________
Thanks SURPASS for all your help and support...
Richard [A xoops user and documentation writer for xoops.org. ]
Website: HouseofStrauss.co.uk Server: Nifty (xx.xxx.238.158)
carnuke is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 22nd, 2007, 3:02 PM   #13 (permalink)
Registered User
Excelling Contributor
 
Joined in Feb 2005
544 posts
Gave thanks: 88
Thanked 24 times
To tell you the truth, it didn't work 100% for me yet, so I gave up on it. I don't have time to find out how to make it work correctly, especially since it's good just for one account.

I had to ask support to check the cron job for me, for I thought it wasn't running, but it turned out that cron was running, but I wasn't getting any emails. The backup files were created on the back up directory though.

I followed the instructions on the link posted on the second reply and used the command
Code:
/home/username/scripts/automysqlbackup.sh
for cron.

For setting up the backup directory on the script, don't use backslash, use just the directory name: "backup"

I guess that's all.
__________________
Patty

Pass 57 | Dime999 | SH 110
Patty is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks Patty for this great post!
carnuke (January 22nd, 2007)
Old January 22nd, 2007, 3:07 PM   #14 (permalink)
Registered User
Comfy Contributor
 
carnuke's Avatar
 
Joined in Apr 2004
Lives in UK
114 posts
Gave thanks: 5
Thanked 0 times
Ok, thanks for that Patty.
__________________
Thanks SURPASS for all your help and support...
Richard [A xoops user and documentation writer for xoops.org. ]
Website: HouseofStrauss.co.uk Server: Nifty (xx.xxx.238.158)
carnuke is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 22nd, 2007, 3:11 PM   #15 (permalink)
Registered User
Excelling Contributor
 
Joined in Feb 2005
544 posts
Gave thanks: 88
Thanked 24 times
U welcome. Good luck!
__________________
Patty

Pass 57 | Dime999 | SH 110
Patty is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old February 11th, 2007, 1:29 PM   #16 (permalink)
Registered User
Seasoned Poster
 
Joined in May 2004
41 posts
Gave thanks: 2
Thanked 2 times
Script

I found this script awhile ago on the cpanel forums. I've been using it ever since, running it from a cron job.

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!

// ********* 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 = "DOMAIN.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 = "USERNAME2"; // Username for FTP account
$ftppass = "PASSWORD2"; // Password for FTP account
$ftphost = "ftp.DOMAIN.com"; // Full hostname or IP address for FTP host
$ftpmode = "ftp"; // FTP mode ("ftp" for active, "passiveftp" for passive)

// Notification information
$notifyemail = "email@domain.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);

?>
johntaikin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
These users thank johntaikin for this great post!
carnuke (February 11th, 2007), mgk (April 18th, 2007)
Old February 11th, 2007, 1:41 PM   #17 (permalink)
Registered User
Comfy Contributor
 
carnuke's Avatar
 
Joined in Apr 2004
Lives in UK
114 posts
Gave thanks: 5
Thanked 0 times
Thanks John, Ill give this a tr y!
__________________
Thanks SURPASS for all your help and support...
Richard [A xoops user and documentation writer for xoops.org. ]
Website: HouseofStrauss.co.uk Server: Nifty (xx.xxx.238.158)
carnuke is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On