Results 1 to 2 of 2

Thread: Script db-calc-storesize for remote host

  1. #1
    Senior Member zmi1's Avatar
    Join Date
    Apr 2009
    Location
    Korneuburg, Austria
    Posts
    169

    Script db-calc-storesize for remote host

    I made a patch to
    /usr/share/doc/zarafa/db-calc-storesize
    because the current version only works if zarafa and mysql are on the same host, which we have not. Fairly trivial, but should be included by Zarafa:

    ------------------- Start DIFF
    10,11c10,12
    < if(@ARGV != 3) {
    < print "Usage: $0 <mysqluser> <mysqlpass> <mysqldb>\n";
    ---
    > if(@ARGV != 4) {
    > print "Usage: $0 <mysqluser> <mysqlpass> <mysqldb> <mysqlhost>\n";
    > print "Soll nur für einen User das Quota berechnet werden, siehe Zeile 68 Kommentar\n";
    15c16
    < my ($user,$pass,$dbname) = @ARGV;
    ---
    > my ($user,$pass,$dbname,$dbhost) = @ARGV;
    17c18
    < my $db = DBI->connect("dbi:mysql:$dbname", $user, $pass);
    ---
    > my $db = DBI->connect("dbi:mysql:$dbname;host=$dbhost", $user, $pass);
    ------------ END DIFF

    Also, if you only need to check one single user, this is the way to do it:
    ---------- START DIFF
    67a69,70
    > # ZMI 20100211: if only one user to correct, do it like this:
    > #$sth = $db->prepare("SELECT hierarchy_id, users.id FROM stores JOIN users ON users.id = stores.user_id where stores.user_id='username'");
    ------------ END DIFF
    I left this one commented out, but it also should be included so someone in need can uncomment and use it. Maybe an option to directly list the username on the commandline would be ideal?
    Michael Monnerie (aka zmi)
    Professional Zarafa Hosting at http://www.proteger.at/produkte/moremail.html

  2. #2
    Senior Member
    Join Date
    Feb 2008
    Location
    Leonberg, Germany
    Posts
    273
    Important: Using stores.user_name to filter for a specific user might be not a great idea. As I had to figure out recently stores.user_name might not be updated when hooking a store and into another user (at least with the database backend). Thus the db-calc-storesize script would update always the wrong user/store.

Similar Threads

  1. Move 7.0.3 Database to a new Host with Zarafa 7.0.4 [solved]
    By Balou84 in forum Installation, Configuration and Maintenance
    Replies: 3
    Last Post: 29-12-2011, 01:44 PM
  2. Client host rejected [Solved]
    By gondolin in forum Installation, Configuration and Maintenance
    Replies: 7
    Last Post: 15-12-2011, 04:18 PM
  3. zarafa-backup on external host
    By Mysterious in forum Installation, Configuration and Maintenance
    Replies: 5
    Last Post: 06-09-2011, 09:52 PM
  4. Script db-convert-attachments-to-files for remote host
    By zmi1 in forum Patches Archives
    Replies: 1
    Last Post: 24-05-2010, 05:58 PM
  5. Problem sending to a host which uses Borderware MXtreme
    By red15 in forum Installation and Configuration Archives
    Replies: 4
    Last Post: 21-11-2008, 01:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •