MDDHosting Forums: New Backup Node Online! More Restoration Points - MDDHosting Forums
New Backup Node Online! More Restoration Points 28 Daily Points (4 weeks).
#1
Posted 06 December 2010 - 10:23 PM
█ LiteSpeed Powered - Shared, Reseller, Semi-Dedicated, and VPS
█ Incremental R1Soft CDP Backups on all shared, semi-dedicated, and VPS services!
█ http://www.mddhosting.com/ - Follow us on Twitter!
#2
Posted 07 December 2010 - 03:03 AM
#3
Posted 07 December 2010 - 02:08 PM
Michael Tran, on 07 December 2010 - 03:03 AM, said:
It does, but an administrator has to perform the restoration. We really ask that you use it for emergencies and not rely upon it for situations such as upgrading your script and it messes up.
Almost every script update asks that you take a manual backup of your database, which is easy to do from your cPanel, before you perform the update... You should still do this
█ LiteSpeed Powered - Shared, Reseller, Semi-Dedicated, and VPS
█ Incremental R1Soft CDP Backups on all shared, semi-dedicated, and VPS services!
█ http://www.mddhosting.com/ - Follow us on Twitter!
#4
Posted 07 December 2010 - 03:38 PM
#5
Posted 07 December 2010 - 03:51 PM
Michael Tran, on 07 December 2010 - 03:38 PM, said:
Doing your own backups is always a good idea and I always recommend that hosting clients no matter who they host with (us, or somebody else) always keep their own off-provider backups just in case.
█ LiteSpeed Powered - Shared, Reseller, Semi-Dedicated, and VPS
█ Incremental R1Soft CDP Backups on all shared, semi-dedicated, and VPS services!
█ http://www.mddhosting.com/ - Follow us on Twitter!
#6
Posted 07 December 2010 - 09:18 PM
What I did was set up a separate Gmail account for it, and then filter all the emails/attachments to the Trash folder so the account doesn't max out. The trash can automatically deletes emails after 20 days, so the whole thing is on auto-pilot with zero maintenance.
Simply run the script nightly as a cron job...
/usr/bin/php / /home/...(your path goes here).../cron_backup.php
<?php
$datestamp = date("Y-m-d"); // Current date to append to filename of backup file in format of YYYY-MM-DD
/* CONFIGURE THE FOLLOWING SEVEN VARIABLES TO MATCH YOUR SETUP */
$dbuser = "database_user"; // Database username
$dbpwd = "database_pass"; // Database password
$dbname = "database_name"; // Database name. Use --all-databases if you have more than one
$filename= "dump_filename-$datestamp.gz"; // The name (and optionally path) of the dump file
$to = "email_address"; // Email address to send dump file to
$from = "mysql_backup@domain.com"; // Email address message will show as coming from.
$subject = "domain.com MySql Backup For: $datestamp"; // Subject of email
/* CONFIGURATION END */
$command = "mysqldump --opt --quick --skip-extended-insert -u $dbuser --password=$dbpwd $dbname | gzip > $filename";
$result = passthru($command);
$attachmentname = array_pop(explode("/", $filename)); // If a path was included, strip it out for the attachment name
$message = "Compressed database backup file $attachmentname attached.";
$mime_boundary = "<<<:" . md5(time());
$data = chunk_split(base64_encode(implode("", file($filename))));
$headers = "From: $from\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: multipart/mixed;\r\n";
$headers .= " boundary=\"".$mime_boundary."\"\r\n";
$content = "This is a multi-part message in MIME format.\r\n\r\n";
$content.= "--".$mime_boundary."\r\n";
$content.= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";
$content.= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$content.= $message."\r\n";
$content.= "--".$mime_boundary."\r\n";
$content.= "Content-Disposition: attachment;\r\n";
$content.= "Content-Type: application/x-gzip; name=\"$attachmentname\"\r\n";
$content.= "Content-Transfer-Encoding: base64\r\n\r\n";
$content.= $data."\r\n";
$content.= "--" . $mime_boundary . "\r\n";
mail($to, $subject, $content, $headers,"-f $from");
unlink($filename); // Delete the backup file from the server (optional)
?>
#7
Posted 08 December 2010 - 11:14 AM
TotalZen, on 07 December 2010 - 09:18 PM, said:
What I did was set up a separate Gmail account for it, and then filter all the emails/attachments to the Trash folder so the account doesn't max out. The trash can automatically deletes emails after 20 days, so the whole thing is on auto-pilot with zero maintenance.
Simply run the script nightly as a cron job...
/usr/bin/php / /home/...(your path goes here).../cron_backup.php
<?php
$datestamp = date("Y-m-d"); // Current date to append to filename of backup file in format of YYYY-MM-DD
/* CONFIGURE THE FOLLOWING SEVEN VARIABLES TO MATCH YOUR SETUP */
$dbuser = "database_user"; // Database username
$dbpwd = "database_pass"; // Database password
$dbname = "database_name"; // Database name. Use --all-databases if you have more than one
$filename= "dump_filename-$datestamp.gz"; // The name (and optionally path) of the dump file
$to = "email_address"; // Email address to send dump file to
$from = "mysql_backup@domain.com"; // Email address message will show as coming from.
$subject = "domain.com MySql Backup For: $datestamp"; // Subject of email
/* CONFIGURATION END */
$command = "mysqldump --opt --quick --skip-extended-insert -u $dbuser --password=$dbpwd $dbname | gzip > $filename";
$result = passthru($command);
$attachmentname = array_pop(explode("/", $filename)); // If a path was included, strip it out for the attachment name
$message = "Compressed database backup file $attachmentname attached.";
$mime_boundary = "<<<:" . md5(time());
$data = chunk_split(base64_encode(implode("", file($filename))));
$headers = "From: $from\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: multipart/mixed;\r\n";
$headers .= " boundary=\"".$mime_boundary."\"\r\n";
$content = "This is a multi-part message in MIME format.\r\n\r\n";
$content.= "--".$mime_boundary."\r\n";
$content.= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";
$content.= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$content.= $message."\r\n";
$content.= "--".$mime_boundary."\r\n";
$content.= "Content-Disposition: attachment;\r\n";
$content.= "Content-Type: application/x-gzip; name=\"$attachmentname\"\r\n";
$content.= "Content-Transfer-Encoding: base64\r\n\r\n";
$content.= $data."\r\n";
$content.= "--" . $mime_boundary . "\r\n";
mail($to, $subject, $content, $headers,"-f $from");
unlink($filename); // Delete the backup file from the server (optional)
?>Nice, my question is where to do you upload this to (I would assume home directly)? and what do you need to name it? backup.php or something different.
#8
Posted 08 December 2010 - 01:21 PM
Blind Bandit, on 08 December 2010 - 11:14 AM, said:
█ LiteSpeed Powered - Shared, Reseller, Semi-Dedicated, and VPS
█ Incremental R1Soft CDP Backups on all shared, semi-dedicated, and VPS services!
█ http://www.mddhosting.com/ - Follow us on Twitter!
#10
Posted 08 December 2010 - 07:20 PM
█ LiteSpeed Powered - Shared, Reseller, Semi-Dedicated, and VPS
█ Incremental R1Soft CDP Backups on all shared, semi-dedicated, and VPS services!
█ http://www.mddhosting.com/ - Follow us on Twitter!
#11
Posted 31 January 2011 - 06:10 PM
TotalZen, on 07 December 2010 - 09:18 PM, said:
What I did was set up a separate Gmail account for it, and then filter all the emails/attachments to the Trash folder so the account doesn't max out. The trash can automatically deletes emails after 20 days, so the whole thing is on auto-pilot with zero maintenance.
Simply run the script nightly as a cron job...
/usr/bin/php / /home/...(your path goes here).../cron_backup.php
<?php
$datestamp = date("Y-m-d"); // Current date to append to filename of backup file in format of YYYY-MM-DD
/* CONFIGURE THE FOLLOWING SEVEN VARIABLES TO MATCH YOUR SETUP */
$dbuser = "database_user"; // Database username
$dbpwd = "database_pass"; // Database password
$dbname = "database_name"; // Database name. Use --all-databases if you have more than one
$filename= "dump_filename-$datestamp.gz"; // The name (and optionally path) of the dump file
$to = "email_address"; // Email address to send dump file to
$from = "mysql_backup@domain.com"; // Email address message will show as coming from.
$subject = "domain.com MySql Backup For: $datestamp"; // Subject of email
/* CONFIGURATION END */
$command = "mysqldump --opt --quick --skip-extended-insert -u $dbuser --password=$dbpwd $dbname | gzip > $filename";
$result = passthru($command);
$attachmentname = array_pop(explode("/", $filename)); // If a path was included, strip it out for the attachment name
$message = "Compressed database backup file $attachmentname attached.";
$mime_boundary = "<<<:" . md5(time());
$data = chunk_split(base64_encode(implode("", file($filename))));
$headers = "From: $from\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: multipart/mixed;\r\n";
$headers .= " boundary=\"".$mime_boundary."\"\r\n";
$content = "This is a multi-part message in MIME format.\r\n\r\n";
$content.= "--".$mime_boundary."\r\n";
$content.= "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n";
$content.= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$content.= $message."\r\n";
$content.= "--".$mime_boundary."\r\n";
$content.= "Content-Disposition: attachment;\r\n";
$content.= "Content-Type: application/x-gzip; name=\"$attachmentname\"\r\n";
$content.= "Content-Transfer-Encoding: base64\r\n\r\n";
$content.= $data."\r\n";
$content.= "--" . $mime_boundary . "\r\n";
mail($to, $subject, $content, $headers,"-f $from");
unlink($filename); // Delete the backup file from the server (optional)
?>Would it be a pain in the ****** to ask you to rewrite this script to make it save a copy of our MySQL database in our MDD FTP folder (preferably "/etc")?
#12
Posted 31 January 2011 - 07:37 PM
stocktrader, on 31 January 2011 - 06:10 PM, said:
The script seems to create the file on disk and simply deletes it after emailing it to you. Replace the unlink call with something that moves the file the an appropriate location and you should be golden.
█ LiteSpeed Powered - Shared, Reseller, Semi-Dedicated, and VPS
█ Incremental R1Soft CDP Backups on all services!
█ http://www.mddhosting.com/ - Follow us on Twitter! @MDDHosting
#13
Posted 31 January 2011 - 11:28 PM
#14
Posted 07 February 2011 - 05:40 PM
#15
Posted 07 February 2011 - 05:49 PM
█ LiteSpeed Powered - Shared, Reseller, Semi-Dedicated, and VPS
█ Incremental R1Soft CDP Backups on all shared, semi-dedicated, and VPS services!
█ http://www.mddhosting.com/ - Follow us on Twitter!
#16
Posted 08 February 2011 - 12:04 AM
The permission denied error comes in the email that the script sends out. I played around with the settings so that the error isn't there anymore but it was replaced by "error: 1045: Access denied for user 'xxxx'@'localhost' (using password: YES) when trying to connect". From my googling, I thought it might be some kind of MySQL user permission-related thing.
I got the script to work, but only when I write the mysqldump command directly into the cron area in CPanel instead of being stored in an external file. But I nated to know if there is any security risk in having my database username and password stored in a script in CPanel?
#17
Posted 08 February 2011 - 12:14 AM
█ LiteSpeed Powered - Shared, Reseller, Semi-Dedicated, and VPS
█ Incremental R1Soft CDP Backups on all shared, semi-dedicated, and VPS services!
█ http://www.mddhosting.com/ - Follow us on Twitter!

Help














