| Site Maintenance Program updates, securing your website, creating backups. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
|
|
#10 (permalink) |
|
Registered User
Comfy Contributor
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) |
|
|
|
|
|
#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 ![]()
__________________
Patty Pass 57 Last edited by Patty; January 22nd, 2007 at 2:48 PM.. |
|
|
|
| This user thanks Patty for this great post! | mgk (April 18th, 2007) |
|
|
#12 (permalink) |
|
Registered User
Comfy Contributor
Joined in Apr 2004
Lives in UK
114 posts
Gave thanks: 5
Thanked 0 times
|
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) |
|
|
|
|
|
#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 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 |
|
|
|
| This user thanks Patty for this great post! | carnuke (January 22nd, 2007) |
|
|
#14 (permalink) |
|
Registered User
Comfy Contributor
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) |
|
|
|
|
|
#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);
?>
|
|
|
|
|
|
#17 (permalink) |
|
Registered User
Comfy Contributor
Joined in Apr 2004
Lives in UK
114 posts
Gave thanks: 5
Thanked 0 times
|
Thanks John, Ill give this a tr
__________________
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) |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|