Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 06:13:58 PM

Pages: [1]   Go Down
  Print  
Author Topic: mysqldump cron under LPCP  (Read 3278 times)
tgibbons
Spaceship Captain
*****
Offline Offline

Posts: 117


« on: August 10, 2010, 08:00:48 PM »

On cpanel accounts I can back up a MySQL database by running this cron command:

mysqldump -uUSER_dbuser -ppassword USER_db | gzip > /home/USER/dbbackup/backup.sql.gz

On an LPCP account I tried the same command with the host added:
mysqldump -hlpsql02.lunariffic.com -uUSER_dbuser -ppassword USER_db | gzip > /home/USER/dbbackup/backup.sql.gz

It doesn't work.  I'm guessing it can't find the mysqldump command, but I have no idea where it might be.

Can anyone help?
Logged

Tom
MrPhil
Berserker Poster
*****
Offline Offline

Posts: 5083



« Reply #1 on: August 11, 2010, 02:14:10 PM »

Did it say it couldn't find mysqldump, or that it didn't like something about the parameters you passed to it? If it appears that it couldn't find the command, you could run the (cron?) shell command find / -name mysqldump -print 2>/dev/null and see if it finds something. It's always possible that command is installed where it isn't accessible to mere mortals. Once you find the command, mysqldump --help should list the options it will accept (-h, -u, -p, and the database name look OK -- if nothing else works, try a space between -h and the hostname, and -u and the user name, but not between -p and the password). Does LPCP use the same database name system (accountname_dbname) as cPanel?
Logged

tgibbons
Spaceship Captain
*****
Offline Offline

Posts: 117


« Reply #2 on: August 11, 2010, 05:27:37 PM »

Thanks! Find found mysqldump at /usr/bin/ so I changed the cron command to:

/usr/bin/mysqldump -hlpsql02.lunariffic.com -uUSER_name -ppassword USER_db | gzip > /home/USER/dbbackup/USER_db.sql.gz

and it works!   Thumbs Up
Logged

Tom
Pages: [1]   Go Up
  Print  
 
Jump to: