Welcome to Geeklog, Anonymous Wednesday, July 06 2022 @ 05:40 am EDT

Geeklog Forums

Backup problem solved - kinda


Dan Jones

Anonymous
Greetings,

Overall, this is a great OpenSource project. The problem I describe is minor.

I'm new to geeklog, fairly new to php, but a longtime sysadmin, so tell me if there's something wrong with my methods.

Short version:
Backup failed (0 byte) because mysqldump did not like the host parameter from config.php. Hardcoding -hlocalhost in database.php, in place of -h$_DB_host (from memory, I may be off), and a small edit in config.php fixes the problem, but in an inelegant way.

Long version:
Setup: geeklog 1.3.8-1sr4, mysql4.0.x, linux RHEL 3.0 AS, multiple mysql instances (mainly different versions 3.x, 4.0.x, 5.x). A 4.0.18 instance is used for geeklog.

So simple definition of the host as localhost does not cut it, as I have lots of mysql*.sock's.

I use $_DB_host = 'localhost:/tmp/mysql40.sock';


Everything works but backup, which fails with a 0 byte file (& folks, if you see 0 byte file there, it's not a permission problem, it was able to write that file..., please chmod -R 770, please)

So, I added the $command var to the error written to error.log, got the command that's being execd by geeklog. Ran the command from the command line and noted the error. mysqldump will not accept localhost:/tmp/mysql40.sock as a valid hostname.

A quick look at database.php, and I hardcoded as noted above, and added -S /tmp/mysql40.sock to $_CONF['mysqldump_options'], yes, I could have hardcoded that as well, but you have to leave something in the config filesWink, and everything works. But it's not REALLY fixed.

As noted elsewhere, backups are a job for cron, not forgetful humans, but in the off chance that a geeklog developer reads this, here's a couple of suggestions.

Option 1:
In the config.php file, have separate options for
-- hostname
-- port
-- socket
use these to build the required php connect strings
localhost:/tmp/mysql40.sock
and the command string for external mysql programs
-hlocalhost -S/tmp/mysql40.sock
I like this solution the best.

Option 2:
Have one parameter in the config file for php use
localhost:/tmp/msysql40.sock
and one for mysqldump
-h localhost -S /tmp/mysql40.sock
or
-h my.database.server -P 3306

Hope this is helpful.

--dj
 Quote

Status: offline

Dan

Forum User
Newbie
Registered: 03/09/04
Posts: 1
Greetings,

I posted the original message. I just set up an account in case anyone needs to contact me. Acct. is Dan

--dj
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
cheerful
Dan,

This makes sense and thanks for the detail report. We can add this to our list of changes to make. I don't know if it can make it into 1.3.9 but certainly the next release.



Geeklog components by PortalParts -- www.portalparts.com
 Quote

All times are EDT. The time is now 05:40 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content