"Scott Barninger" <[email protected]> kirjoitti viestissä news:[email protected]...
On Sunday 07 February 2010 01:03:44 pm you wrote:
"Scott Barninger" <[email protected]> kirjoitti viestissä
news:[email protected]...


Hmm, this is the script that should have run during the upgrade for a 32 bit
system:

Actually, this is 64-bit system. But I guess that's unessential if I found the glue...


#check, if mysql can be called successfully at all
if mysql 2>/dev/null bacula -e 'select * from Version;' ; then

# test for an existing database
# note: this ASSUMES no password has been set for bacula database
DB_VER=`mysql 2>/dev/null bacula -e 'select * from Version;'|tail -n 1`

# grant privileges and create tables if they do not exist
if [ -z "$DB_VER" ]; then
   echo "Hmm, it doesn't look like you have an existing database."
   echo "Granting privileges for MySQL user bacula..."
   /usr/lib/bacula/grant_mysql_privileges
   echo "Creating MySQL bacula database..."
   /usr/lib/bacula/create_mysql_database
   echo "Creating bacula tables..."
   /usr/lib/bacula/make_mysql_tables

# check to see if we need to upgrade a 3.x database
elif [ "$DB_VER" -lt "11" ]; then
**************
   echo "This release requires an upgrade to your bacula database."
   echo "Backing up your current database..."
mysqldump -f --opt bacula | bzip2 > /var/lib/bacula/bacula_backup.sql.bz2
   echo "Upgrading bacula database ..."
   /usr/lib/bacula/update_mysql_tables
   echo "If bacula works correctly you can remove the backup
file /var/lib/bacula/bacula_backup.sql.bz2"

fi
fi

Could you please run the following command on the rpm package that you built and let me know the results with particular attention to the location of the
update_mysql_table script:

rpm -qp --scripts bacula-mysql-5.0.0-1...

Output of the above attached. What came into my mind... is the test in line 100 in the attachment (similar to the one I highlighted above with *******) wrong way:

elif [ "$DB_VER" -lt "11" ]; then
   echo "This release requires an upgrade to your bacula database."

Does this skip the update, if the old level was 11? A long time since I had shell scripts for breakfast, but I read that
"if database version is less than 11 then run the update..."
I think it should run when equal to 11?

--
TiN

Attachment: 500-rpm-script
Description: Binary data

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to