---------- Forwarded message ----------
From: Frank Altpeter <[EMAIL PROTECTED]>
Date: Feb 20, 2007 7:00 PM
Subject: Re: [Bacula-users] Cleaning up database records
To: Kern Sibbald <[EMAIL PROTECTED]>
I'm running dbcheck periodically every sunday with the following script:
------------------------------------------------------------------------------------------------
#!/bin/sh
PATH="/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin"
echo "$(date) Creating temp indices for bacula database..."
mysql -ubacula <<EOFA
use bacula
CREATE INDEX file_tmp_filenameid_idx ON File (FilenameId);
CREATE INDEX file_tmp_pathid_idx ON File (PathId);
EOFA
echo "$(date) Running dbcheck..."
dbcheck -c /usr/local/etc/bacula-dir.conf -f -b -v
echo "$(date) Removing indices and optimizing bacula database..."
mysql -ubacula <<EOFB
use bacula
DROP INDEX file_tmp_filenameid_idx ON File;
DROP INDEX file_tmp_pathid_idx ON File;
OPTIMIZE TABLE UnsavedFiles, Counters, CDImages, BaseFiles, Device,
Version, Status, MediaType, Storage, FileSet, Client, Pool, Media,
Job, JobMedia, File, Path, Filename;
EOFB
echo "$(date) Done..."
------------------------------------------------------------------------------------------------
Due to the additional index entries, the script runs for about 90
minutes (eternally without them) with a database of 24 million file
entries from 88 clients, mostly application servers.
It helps a lot, but still it doesn't help against orphaned entries
from previously removed clients.
--
Le deagh dhùraghd,
Frank Altpeter
Two of the most famous products of Berkeley are LSD and Unix.
I don't think that this is a coincidence.
-- Anonymous
--
Le deagh dhùraghd,
Frank Altpeter
Two of the most famous products of Berkeley are LSD and Unix.
I don't think that this is a coincidence.
-- Anonymous
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users