#1 (permalink)  
Old 04-15-2007, 06:35 PM
Registered User
 
Join Date: Apr 2007
Posts: 2
squiggerz is on a distinguished road
Angry Backup Script - Total Newb

Alright, I have 3 separate hosting accounts, all from the same provider, each running around 60 sites on average. I've been hacking away (no, not code hacking, just hacking it to death) at this php script I found on cputils.com that allows you to view disk usage from cPanel for all accounts. What I am trying to do is use this script to take the disk usage for all accounts on the hosting plan, have a backup script (also hacked to death and found at the same site) schedule backups according to size of site and automate it over the 7 day week from 6pm to 8am the next day.

My question is, does this idea even sound feasible?

My other option is to just have the script download all the backups in the WHM when called.

I have read over the 'smarter backup script' located on this site, which sounded exactly like what I am trying to do. Only problem is, I cant access the site via a shell, or at least thats what my limited experience leads me to believe.

I have access to a Debian box however, if there might be some way for me to access this server through it and use that smarter script via my debian installation, if anybody here has the free time to explain even a fraction of what would be necessary to get this show on the road I would greatly appreciate any help you could offer.

Now, can somebody help me with this php issue??

<?php
$whmUser = '*****';
$whmPass = '*****';
$cpUser = '*****';
$cpPass = '*****';
$url = 'www.*****.com';
$cpTheme = 'rvblue';
$msg = 'Timestamp: '.date("F j, Y, g:i a")."\n\n";
//get WHM list accounts
$page2 = @file_get_contents("http://$whmUser:$whmPass@$url:2086/scripts2/listaccts?viewall=1",'r');
//get each account table row
$int2 = preg_match_all("/<tr class=(?:tdshade2|tdshade1)>(.*?)<\/tr>/is", $page2, $matches);

if($int2 >= 0 && is_array($matches[1])) {
foreach($matches[1] as $match) {
$account = explode('</td><td>',$match);
$msg .= 'Domain: '.strip_tags($account[0]).' -- Space used: '.$account[0]."\n";
echo $match[1];
}
echo "IF is true, but foreach not working";
}
else {
$msg .= "\n<br>Error<br>\n";
echo $msg;
}
?>

Hopefully somebody else can see what I am not. I'm an extremely green php kiddie at the moment, but I'm guessing something has to be going wrong in the preg_match_all function... anybody??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

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



All times are GMT -5. The time now is 12:03 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc