Page 41 of 66 FirstFirst ... 31394041424351 ... LastLast
Results 401 to 410 of 659

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

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

    Default

    Are you running Zimbra as root? The script runs this routine to determine the Zimbra user:
    Code:
    # Find out who is the zimbra proc user
    ZM_USER=`ps -ef | grep "$ZM_HOME" | grep "java" | grep -v "zmmailboxdmgr" | grep
     -v grep | awk '{print $1}' | head -n 1`
    if [ -z $ZM_USER ]
    then
        echo "Unable to determine the zimbra user!"
        config_fail
    elif [ "$ZM_USER" = "root" ]
    then
        echo "Zimbra user should never be root!"
        config_fail
    fi

  2. #402
    primaxx is offline Active Member
    Join Date
    Mar 2009
    Location
    Oslo, Norway
    Posts
    47
    Rep Power
    6

    Default

    Thank you for the response!

    Yes, I noticed that part of the script.
    What is strange is that this has been running smooth for a long time until it suddenly stopped working. (This has actually happened to me before also, but then a restart of the server have solved the problem. not so now...)

    Embarassing question, but how do I check if I run Zimbra as root?

    Edit:
    Today I am running (in cron) the script as the user "administrator".
    The path to the script is /home/administrator/scripts/zmbak_v.0.6..sh
    The permissions etc on the scriptfile is -rwxr-xr-x 1 administrator:administrator.

    If I want to run it manually, what user am I supposed to run it as?
    What is eventually wrong with the permissions and the ownership?
    -Or are there something else that is totally wrong? (Confused...)
    Last edited by primaxx; 10-05-2010 at 05:32 AM. Reason: Clearifying

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

    Default

    Quote Originally Posted by primaxx View Post
    Thank you for the response!

    Yes, I noticed that part of the script.
    What is strange is that this has been running smooth for a long time until it suddenly stopped working. (This has actually happened to me before also, but then a restart of the server have solved the problem. not so now...)

    Embarassing question, but how do I check if I run Zimbra as root?
    Just run the command from the script, substituting the path to your Zimbra install for the $ZM_HOME variable, e.g. '/opt/zimbra':
    Code:
    [root@mail sbin]# ps -ef | grep '/opt/zimbra' | grep "java" | grep -v "zmmailboxdmgr" | grep -v grep | awk '{print $1}' | head -n 1
    zimbra
    [root@mail sbin]#
    Edit:
    Today I am running (in cron) the script as the user "administrator".
    The path to the script is /home/administrator/scripts/zmbak_v.0.6..sh
    The permissions etc on the scriptfile is -rwxr-xr-x 1 administrator:administrator.
    It won't matter who owns the script, just who runs it. The script should be run as root. Zimbra should run as the Zimbra user, ordinarily 'zimbra'.
    If I want to run it manually, what user am I supposed to run it as?
    What is eventually wrong with the permissions and the ownership?
    -Or are there something else that is totally wrong? (Confused...)
    How are you starting Zimbra? The init script should run it as the 'zimbra' user by default. Or you can start Zimbra when you are the 'zimbra' user:
    Code:
    [root@mail sbin]# su - zimbra
    [zimbra@mail ~]$ zmcontrol start
    or 'zmcontrol restart', depending.

  4. #404
    primaxx is offline Active Member
    Join Date
    Mar 2009
    Location
    Oslo, Norway
    Posts
    47
    Rep Power
    6

    Default

    LaFong, thankyou so much for helping me out here!

    When I ran the command from the script it returned "root".
    I then, as I always do, ran the commands "sudo su" and the "su zimbra". And then "zmcontrol restart".
    Still it reports "root" when I run the command from the script.
    If I do it like you suggest (without the "sudo su"), I am asked for a password I don't know.

    I do believe now that my problems are slightly fading away from the main issue in this thread, please forgive me. If I don't get an answer here I will head over to the Ubuntu-forums instead... (But I can eventually come back here and post the solution...)

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

    Default

    Quote Originally Posted by primaxx View Post
    LaFong, thankyou so much for helping me out here!

    When I ran the command from the script it returned "root".
    I then, as I always do, ran the commands "sudo su" and the "su zimbra".
    And then "zmcontrol restart".
    Try it this way:
    Code:
    [myuser@mail ~]$ sudo su
    Password:   (type your password)
    [root@mail ~]# su - zimbra   (no password needed)
    [zimbra@mail ~]$ zmcontrol restart
    The "-" in the command makes it a login shell, giving you the environment variables of the user you are su'ing to. I assume you are "sudo su"-ing because your /etc/sudoers file is set that way. I'm used to using plain "su -" with the root password.
    Still it reports "root" when I run the command from the script.
    Seems like you are running Zimbra as root, which is not good. If that is so, you may have to chown your Zimbra directory after fixing the problem.
    If I do it like you suggest (without the "sudo su"), I am asked for a password I don't know.
    If you "su - zimbra" as a user other than root, you will be prompted for the zimbra user password. My previous post assumed you already had a root shell. Use "sudo su" first, as you've done before

    You'll need to figure out why Zimbra is being run by root, which may be Ubuntu related. Good luck.

  6. #406
    primaxx is offline Active Member
    Join Date
    Mar 2009
    Location
    Oslo, Norway
    Posts
    47
    Rep Power
    6

    Default

    Thank you again!
    I tried your last suggestion, but it made no difference (as far as I could see.) (There should really be a space between the "-" and "zimbra", right?).

    I will now start a new thread in the administrator-forum so I'm not hijacking this one!

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

    Default

    Quote Originally Posted by primaxx View Post
    Thank you again!
    I tried your last suggestion, but it made no difference (as far as I could see.) (There should really be a space between the "-" and "zimbra", right?).
    Yes. The problem is probably not the script at all, but running Zimbra as root. Starting a new thread is the way to go.

  8. #408
    primaxx is offline Active Member
    Join Date
    Mar 2009
    Location
    Oslo, Norway
    Posts
    47
    Rep Power
    6

    Default

    I just want to close my issue with "running Zimbra as root", by saying the solution can be found in this thread.

  9. #409
    dipeshmehta is offline Special Member
    Join Date
    Jun 2010
    Location
    Rajkot, India
    Posts
    159
    Rep Power
    4

    Default

    Hello Heinzg,

    Thanks for a wonderful script for FOSS Edition.

    I just installed ZCS 6.0.8 (64 bit) on Ubuntu 8.04. Installed zmbak_v.0.8.sh and configured its config part to my environment. When I ran it from command line (-f switch), it backs up perfectly, but not logged. zim_backup.log file has timestamp of starting of backup process, but is of 0 size. Similarly, email received is also blank.

    Following are my config lines: (I have removed commented out lines, or generic lines)
    Code:
    ##------- CONFIG -------#
    ZM_HOME=/opt/zimbra/    
    SYNC_DIR=/tmp/fakebackup/       
    ARCHIVEDIR=/backup/zimbra_server/       
    TO_MEDIA_DIR=/backup/burn/
    
    #--- PROGRAM OPTIONS ---#
    RSYNC_OPTS="-aHK --delete --exclude=*.pid" 
    
    #--- ARCHIVE NAMES ---#
    BACKUPNAME="ZimbraBackup"       
    FULL_PREFIX="FULL"   
    DIFF_PREFIX="DIFF"      
    BACKUPDATE=`date +%Y%m%d`       
    BACKUPWEEKFILE="/opt/zimbra/backup.week"
    BACKUPWEEK=`cat $BACKUPWEEKFILE`        
    
    #--- ARCHIVE SIZE ---#
    ARCHIVESIZE="4395M"     
    COMPRESS="9"            
    
    #--- Encryption Options ---#
    CRYPT="no"              
    
    #--- Log Settings ---#
    EMAIL="me@mydomain.tld" 
    EMAILCC=""                              
    LOG="/var/log/zim_backup.log"   
    ATTACHLIST="no"                 
    FILTERLIST="yes"  
    
    #--- SSH REMOTE DR COPY ---#
    DRCP="no"               
    
    #--- Use Hacks? ---#
    STATHACK="yes"
    and following is output on console:
    Code:
    root@host:/etc# ./zmbak_v.0.8.sh -f
    ============================
    Mon Oct 18 15:07:25 IST 2010
    Performing FULL backup
    ============================
    full Backup started at: Mon Oct 18 15:07:25 IST 2010
    No old backups found
    Setting date & version Marker into /opt/zimbra/DATE_VERSION.txt
    Doing a hotsync of /opt/zimbra/ to /tmp/fakebackup/
    Disabling the Zimbra crontab...
    Stopping the Zimbra server...
    
    Host host.domain.tld
            Stopping stats...Done.
            Stopping mta...Done.
            Stopping spell...Done.
            Stopping snmp...Done.
            Stopping archiving...Done.
            Stopping antivirus...Done.
            Stopping antispam...Done.
            Stopping imapproxy...Done.
            Stopping memcached...Done.
            Stopping mailbox...Done.
            Stopping logger...Done.
            Stopping ldap...Done.
    Doing a fast cold sync...
    Reinstating Zimbra's crontab...
    Starting Zimbra...
    Host host.domain.tld
            Starting ldap...Done.
            Starting logger...Done.
            Starting mailbox...Done.
            Starting antispam...Done.
            Starting antivirus...Done.
            Starting snmp...Done.
            Starting spell...Done.
            Starting mta...Done.
            Starting stats...Done.
    Service down time was - Hr:0 Min:2 Sec:23
    Running A hack... This one to check and start Stats subsystem
    Hack not needed Stats seems to be running fine...
    Writing a full backup: 42_ZimbraBackup_20101018_FULL
    into: /backup/zimbra_server/ with file sizes of max: 4395M
    Saving Unencrtyped Archive...
    
     --------------------------------------------
     34735 inode(s) saved
     with 785 hard link(s) recorded
     0 inode(s) changed at the moment of the backup
     0 inode(s) not saved (no inode/file change)
     0 inode(s) failed to save (filesystem error)
     0 inode(s) ignored (excluded by filters)
     0 inode(s) recorded as deleted from reference backup
     --------------------------------------------
     Total number of inode considered: 34735
     --------------------------------------------
     EA saved for 0 inode(s)
     --------------------------------------------
    Creating MD5 Checksum for 42_ZimbraBackup_20101018_FULL.1.dar...
    Creating file listing from archive...
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    full Zimbra Backup ended at: 15:16
    Backup took Hr:0 Min:8 Sec:47 to complete
    :::::::::::::::Cheers Osoffice for the script:::::::::::::::::::::::
    Null message body; hope that's ok
    Please tell me where I am doing wrong?

    Dipesh

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

    Default

    Is zim_backup.log writable by root?
    Code:
    [root@mail]$ ls -l /var/log/zim_backup.log
    -rw-r--r-- 1 root    root       13790 Oct 18 06:13 zim_backup.log
    No errors in /var/log/messages?

Page 41 of 66 FirstFirst ... 31394041424351 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 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
  •