Page 31 of 66 FirstFirst ... 21293031323341 ... LastLast
Results 301 to 310 of 659

Thread: [SOLVED] Yet Another Backup Script for Community Version

  1. #301
    borngunners is offline Advanced Member
    Join Date
    Jun 2009
    Posts
    195
    Rep Power
    6

    Default

    You mean as a zimbra user or root?
    root@mail:/var/tmp/restore# su zimbra
    zimbra@mail:/var/tmp/restore$ /var/tmp/restore/recreate_inbox.sh test@account.mail.com /opt/zimbra/store/23/msg
    /var/tmp/restore/recreate_inbox.sh: 12: function: not found
    /var/tmp/restore/recreate_inbox.sh: 20: checkDirectory: not found
    /var/tmp/restore/recreate_inbox.sh: 21: Syntax error: "}" unexpected
    zimbra@mail:/var/tmp/restore$
    Last edited by borngunners; 04-27-2010 at 01:00 PM.

  2. #302
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    Quote Originally Posted by borngunners View Post
    You mean as a zimbra user or root?
    "Run as the Zimbra user, in a directory you have write privileges to, on a partition with enough space. "

  3. #303
    borngunners is offline Advanced Member
    Join Date
    Jun 2009
    Posts
    195
    Rep Power
    6

    Default

    I ran it as a zimbra user in the /opt/zimbra/..... partition directory, which I believe zimbra user have write privileges to and this is what I got:
    root@mail:/var/tmp/restore# su zimbra
    zimbra@mail:/var/tmp/restore$ /var/tmp/restore/recreate_inbox.sh test@account.mail.com /opt/zimbra/store/23/msg
    /var/tmp/restore/recreate_inbox.sh: 12: function: not found
    /var/tmp/restore/recreate_inbox.sh: 20: checkDirectory: not found
    /var/tmp/restore/recreate_inbox.sh: 21: Syntax error: "}" unexpected
    zimbra@mail:/var/tmp/restore$

  4. #304
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    Seems like you haven't copied the script right. If a '}' is unexpected, perhaps a '{' is missing.

    You can test the script, without running it, like this:
    Code:
    zimbra@mail:/var/tmp/restore$ bash -n /var/tmp/restore/recreate_inbox.sh
    Also you should switch to the zimbra user this way:
    Code:
    zimbra@mail:/var/tmp/restore$ su - zimbra
    The "-" makes it a login shell, and reads all of the zimbra user login files and variables.

  5. #305
    borngunners is offline Advanced Member
    Join Date
    Jun 2009
    Posts
    195
    Rep Power
    6

    Default

    Quote Originally Posted by LaFong View Post
    Seems like you haven't copied the script right. If a '}' is unexpected, perhaps a '{' is missing.

    You can test the script, without running it, like this:
    Code:
    zimbra@mail:/var/tmp/restore$ bash -n /var/tmp/restore/recreate_inbox.sh
    Also you should switch to the zimbra user this way:
    Code:
    zimbra@mail:/var/tmp/restore$ su - zimbra
    The "-" makes it a login shell, and reads all of the zimbra user login files and variables.
    I just did and this is what i got:
    Code:
    zimbra@mail:~$ bash -n /var/tmp/restore/recreate_inbox.sh
    zimbra@mail:~$
    To me, it seems nothing is wrong with the script....

  6. #306
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    Quote Originally Posted by borngunners View Post
    I just did and this is what i got:
    Code:
    zimbra@mail:~$ bash -n /var/tmp/restore/recreate_inbox.sh
    zimbra@mail:~$
    To me, it seems nothing is wrong with the script....
    Well, nothing was obvious to the bash syntax checker anyway. I did find one quote mark out of place and fixed that in my post. Possibly this has something to do with your function } error, but it's hard to see how. I just ran it on a user account that had 10,000 messages, it worked fine.

    Also, you cannot run this script on another server without recreating the zimbra MySQL databases over there. In order to parse which messages are for the Inbox, it does a MySQL query. So, you will have to choose one of options in Step 4. Theoretically, you could do a MySQL query from the new server to the old, with a change to the mysql command.

  7. #307
    borngunners is offline Advanced Member
    Join Date
    Jun 2009
    Posts
    195
    Rep Power
    6

    Default

    Which one of the post are you refering to? the one that you posted after me initially, or an old post several months ago? Also, is it possible to do 4c on the new server? All I want to do is restore the email on the new server and export the deleted emails then import into the user account in the old email server.
    thanks for your help so far...

  8. #308
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    Quote Originally Posted by borngunners View Post
    Which one of the post are you refering to? the one that you posted after me initially, or an old post several months ago?
    This post.
    Also, is it possible to do 4c on the new server? All I want to do is restore the email on the new server and export the deleted emails then import into the user account in the old email server.
    thanks for your help so far...
    Yes:
    1. Copy over the user's msg directory from their archived store to the new server.
    2. Create a database on the new server named the same as the user's mailbox on the old server, e.g. "mboxgroup8". You can do this with mysql, webmin, phpMyAdmin, etc.
    3. Give permissions to the database.
    4. Stop MySQL on the new server.
    5. Copy the archived database directory from the old server to the new server, replacing the one you just created. (You may have to change its ownership to match the other dbs on the new server)
    6. Restart the MySQL server.
    7. Run the 1st script. You now have their Inbox messages in a directory.
    8. Run the 2nd script to add the header dates.
    9. Copy the processed messages folder back to the old server.
    10. Add the messages back into the user's account per the earlier post.


    If you are trying to duplicate the user into a duplicate Zimbra install (why?), you would also need their mailbox and mailbox_metadata db entries. If you don't want to restore the whole user on the new server, you don't need Zimbra on the new server, just MySQL.

  9. #309
    borngunners is offline Advanced Member
    Join Date
    Jun 2009
    Posts
    195
    Rep Power
    6

    Default

    Quote Originally Posted by LaFong View Post
    This post.

    Yes:
    1. Copy over the user's msg directory from their archived store to the new server.
    2. Create a database on the new server named the same as the user's mailbox on the old server, e.g. "mboxgroup8". You can do this with mysql, webmin, phpMyAdmin, etc.
    3. Give permissions to the database.
    4. Stop MySQL on the new server.
    5. Copy the archived database directory from the old server to the new server, replacing the one you just created. (You may have to change its ownership to match the other dbs on the new server)
    6. Restart the MySQL server.
    7. Run the 1st script. You now have their Inbox messages in a directory.
    8. Run the 2nd script to add the header dates.
    9. Copy the processed messages folder back to the old server.
    10. Add the messages back into the user's account per the earlier post.


    If you are trying to duplicate the user into a duplicate Zimbra install (why?), you would also need their mailbox and mailbox_metadata db entries. If you don't want to restore the whole user on the new server, you don't need Zimbra on the new server, just MySQL.
    LaFong. I guess I will need you to elaborate more with specific commands because I am not advance with command lines in linux....This is the error message I am getting for both zimbra user and root:
    Code:
    zimbra@mail:~$ mysql
    ERROR 1045 (28000): Access denied for user 'zimbra'@'localhost' (using password: YES)
    zimbra@mail:~$
    [
    Last edited by phoenix; 05-01-2010 at 09:59 AM.

  10. #310
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    LaFong. I guess I will need you to elaborate more with specific commands because I am not advance with command lines in linux....
    Well, rather than weigh down the forum with linux instructions, why don't you just PM me? Please ask specific questions in your PM.

    This is the error message I am getting for both zimbra user and root:
    Code:
    zimbra@mail:~$ mysql
    ERROR 1045 (28000): Access denied for user 'zimbra'@'localhost' (using password: YES)
    zimbra@mail:~$
    [
    This means it wants the password. If you are using a zimbra login shell on a Zimbra server, it shouldn't need to be provided. At least, it's not required for me.
    Code:
    [zimbra@mail ~]$ mysql
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 4338
    Server version: 5.0.87-log Source distribution
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql>
    You can provide the password:
    Code:
    [zimbra@mail ~]$ zmlocalconfig -s | grep zimbra_mysql_password | awk '{print $3}'
    MbvlxxapwUIxGqZo99.zG6Kj
    [zimbra@mail ~]$ mysql -p                         
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 4363
    Server version: 5.0.87-log Source distribution
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql>
    You can then change the mysql line in the script to include the password:
    Code:
    mysql -p MbvlxxapwUIxGqZo99.zG6Kj -N -e "SELECT index_id FROM mail_item WHERE folder_id=2" mboxgroup$mailboxId | grep -v + > /tmp/Inbox_Ids

Page 31 of 66 FirstFirst ... 21293031323341 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Zimbra Backup Script ... Small Problem
    By frankb in forum Administrators
    Replies: 12
    Last Post: 07-14-2008, 08:40 AM
  2. Debian - Upgrade from 4.5.6
    By magikman in forum Installation
    Replies: 1
    Last Post: 01-19-2008, 12:59 PM
  3. Backup script issues
    By SSS in forum Administrators
    Replies: 18
    Last Post: 12-03-2007, 09:56 AM
  4. 4.0.4 to 4.5.6 upgrade failed in network edition
    By chenthil in forum Administrators
    Replies: 1
    Last Post: 08-27-2007, 09:36 AM
  5. [SOLVED] Simple backup question...
    By dameron in forum Administrators
    Replies: 3
    Last Post: 08-25-2007, 09:36 PM

Posting Permissions

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