Error when start zimbra by script
i install zimbra mail zcs 8.0.6 on ubuntu server 12.04
i have a script to backup: #!/bin/sh DIR_SRC=/opt/zimbra DIR_DST=/bkpZimbra FILE="Backup_Zimbra_"`date +%Y%m%d%H%M%S`".tar.gz" #stop zimbra echo "Stop Zimbra service" sudo -u zimbra /opt/zimbra/bin/zmcontrol stop #stop pending zimbra process echo "Kill other pending zimbra process" ps auxww | awk '{print $1" "$2}' | grep zimbra | kill -9 `awk '{print $2}'` #generate backup file echo "Begin generate back up file. Waitting ....." tar cpzf ${DIR_DST}/${FILE} ${DIR_SRC} echo "Back up file done. " #put backup an an ftp server echo "Begin upload to FTP. Waitting" curl -T ${DIR_DST}/${FILE} ftp://192.168.1.100 -u $USERNAME:$PASSWORD echo "Upload back up file to FTP done" #clean backup file echo "Deleting uploaded file" rm -f ${DIR_DST}/${FILE} echo "Delete done" #start zimbra sudo -u zimbra /opt/zimbra/bin/zmcontrol start echo "Back up done" When th script start zimbra i have a problem with "logger" like this: Host ubuntu.local Starting ldap...Done. Starting zmconfigd...Done. Starting logger...Failed. Starting logswatch...failed. Starting mailbox...Done. Starting antispam...Done. Starting antivirus...Done. Starting opendkim...Done. Starting snmp...Done. Starting spell...Done. Starting mta...Done. Starting stats...Done. But when i start zimbra by command like this, it works. i don't understand to fix the problem above root@ubuntu:~# su zimbra zimbra@ubuntu:/root$ zmcontrol start Host ubuntu.local Starting zmconfigd...Done. Starting logger...Done. Starting mailbox...Done. Starting antispam...Done. Starting antivirus...Done. Starting opendkim...Done. Starting snmp...Done. Starting spell...Done. Starting mta...Done. Starting stats...Done. |
Hi,
Better use su instead of sudo in the stop/start zimbra commands. I.e replace: Quote:
Code:
su - zimbra -c "/opt/zimbra/bin/zmcontrol stop" |
Quote:
Error script: ......... Host ubuntu.local Starting ldap...Done. dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied Starting zmconfigd...Done. dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied Starting logger...Failed. Starting logswatch...failed. dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied Starting mailbox...Done. Starting antispam...Done. Starting antivirus...Done. Starting opendkim...Failed. opendkim: /opt/zimbra/conf/opendkim.conf: ldap://ubuntu.local:389/?DKIMSelector?sub?(DKIMIdentity=$d): dkimf_db_open(): Connect error Failed to start opendkim: 0 Starting snmp...Done. Starting spell...Done. dpkg: warning: failed to open configuration file '/root/.dpkg.cfg' for reading: Permission denied Starting mta...Done. Starting stats...Done. |
Quote:
I'm using this backup script on Centos and it works fine. Perhaps you could give it a try. |
All times are GMT -5. The time now is 02:13 AM. |