Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using WHM's automated backup system to make daily backups of my database. I have it set that it only makes a backup of what has changed. I've had this running for a while now and thought it was working fine until I tried downloading the backup today, and realized there was nothing in it. The only text inside of the sql file is:

-- MySQL dump 10.11
--
-- Host: localhost    Database: pokerrpg_pokerrpg
-- ------------------------------------------------------
-- Server version   5.0.81-community-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

Do you have WHM set to keep weekly or monthly backups as well? Check the /pathtobackupfolder/cpbackups/weekly/ and see if you happen to have a full copy in there. I've personally never had anything but frustration come from trying to use WHM's backup feature. It's really just an un-tarred pkgacct file. You can do some really simple mysql backups with mysqldump and cron.

/usr/bin/mysqldump -u db_user -pdb_user_pass db_name > /full/path/to/dumpfile.sql

Where 'db_user' is the database username, 'db_user_pass' is that database user's password, 'db_name' is the name of the database to be dumped, and '/full/path/to/dumpfile.sql' is the location that you'd like the database to be dumped to.

You can also create a .my.cnf (note leading . is needed) in your /home/username directory containing the following:

[client]
user = DBUSERNAME
password = DBPASSWORD
host = localhost

[mysql]
database = DBNAME

(Where DBUSERNAME, DBPASSWORD, DBNAME refer to Database username, password, and database name.)

Adding this as your cron job:

mysqldump > /full/path/to/dumpfile.sql

You can set up cron jobs through cPanel->'Cron Jobs'

share|improve this answer
    
No, I just have it set to save daily. The problem with this is that I am saving to a 20GB NAS and my database is around 1.5GB, so this would fill up quickly without the feature that WHM has to only save what has changed. –  James Simpson Jul 26 '09 at 2:44
    
Ick, if that's the case I would hit up cPanel support and tell them to fix their shi**y backup system, but since that never works, I would do a couple of tests. Since you don't have anything now, it seems like you can play with the settings a bit.. I would delete the ../daily folder and run the backup manually /scripts/cpbackup then make some changes and run it again. After you do that check in /usr/local/cpanel/logs/error_log (maybe others) and see if anything sticks out. –  jemmille Jul 26 '09 at 3:11
add comment

Yes, I was just testing one of my backup after so long. Guess what, the "Account Restore" backup only created the database, but not the tables/data inside it.

I should try your mysqldump.

Thanks

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.