Results 1 to 3 of 3

Thread: Backup script doesn't work

  1. #1
    antoseri is offline Beginner Member
    Join Date
    Sep 2013
    Posts
    1
    Rep Power
    1

    Default Backup script doesn't work

    Hi to everyone. I have zimbra (open source edition) version 8.0.3 on ubuntu server 12.04. I'm trying to generate a script for backup af entire folder /opt/zimbra. Here's my code:
    Code:
    #!/bin/sh
    
    DIR_SRC=/opt/zimbra
    DIR_DST=XXXXXXXXXX
    FILE="Backup_Zimbra_"`date +%Y%m%d%H%M%S`".tar.gz"
    
    USERNAME="xxx"
    PASSWORD="xxx"
    SERVER="xxx.xxx.xxx.xxx"
    
    #stop zimbra
    sudo -u zimbra /opt/zimbra/bin/zmcontrol stop
    
    #stop pending zimbra process
    ps auxww | awk '{print $1" "$2}' | grep zimbra | kill -9 `awk '{print $2}'`
    
    #generate backup file
    tar cpzf ${DIR_DST}/${FILE} ${DIR_SRC}
    
    #put backup an an ftp server
    curl -T ${DIR_DST}/${FILE} ftp://192.168.0.100 -u $USERNAME:$PASSWORD
    
    #clean backup file
    rm -f ${DIR_DST}/${FILE}
    
    #start zimbra
    sudo -u zimbra /opt/zimbra/bin/zmcontrol start
    When I run the script I obtain the following screen messages:
    Code:
    root@mail:/opt/backup/script# ./backup.sh
    dpkg: attenzione: apertura del file di configurazione "/root/.dpkg.cfg" per la lettura non riuscita: Permesso negato
    dpkg: attenzione: apertura del file di configurazione "/root/.dpkg.cfg" per la lettura non riuscita: Permesso negato
    Host mail.xxxxxxxx.com
            Stopping vmware-ha...Done.
            Stopping zmconfigd...Done.
            Stopping stats...Done.
            Stopping mta...Done.
            Stopping spell...Done.
            Stopping snmp...Done.
            Stopping cbpolicyd...Done.
            Stopping archiving...Done.
            Stopping antivirus...Done.
            Stopping antispam...Done.
            Stopping proxy...Done.
            Stopping memcached...Done.
            Stopping mailbox...Done.
            Stopping logger...Done.
            Stopping ldap...Done.
    tar: Rimozione di "/" iniziale dai nomi dei membri
    tar: Rimozione di "/" iniziale dagli obiettivi dei collegamenti fisici
    tar: /opt/zimbra/data/postfix/spool/private/local: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/lmtp: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/tlsmgr: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/discard: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/cyrus: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/maildrop: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/retry: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/virtual: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/bounce: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/anvil: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/scan: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/smtp-amavis: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/uucp: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/rewrite: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/ifmail: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/defer: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/scache: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/relay: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/old-cyrus: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/trace: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/error: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/proxymap: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/bsmtp: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/verify: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/private/smtp: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/public/flush: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/public/showq: socket ignorato
    tar: /opt/zimbra/data/postfix/spool/public/cleanup: socket ignorato
    
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  897M    0     0  100  897M      0  10.9M  0:01:22  0:01:22 --:--:-- 10.0M
    
    Host mail.xxxxxxxx.com
            Starting ldap...Done.
    dpkg: attenzione: apertura del file di configurazione "/root/.dpkg.cfg" per la lettura non riuscita: Permesso negato
            Starting zmconfigd...Done.
    dpkg: attenzione: apertura del file di configurazione "/root/.dpkg.cfg" per la lettura non riuscita: Permesso negato
            Starting logger...Failed.
    Starting logswatch...failed.
    
    
    dpkg: attenzione: apertura del file di configurazione "/root/.dpkg.cfg" per la lettura non riuscita: Permesso negato
    dpkg: attenzione: apertura del file di configurazione "/root/.dpkg.cfg" per la lettura non riuscita: Permesso negato
    dpkg: attenzione: apertura del file di configurazione "/root/.dpkg.cfg" per la lettura non riuscita: Permesso negato
    dpkg: attenzione: apertura del file di configurazione "/root/.dpkg.cfg" per la lettura non riuscita: Permesso negato
            Starting mailbox...Done.
            Starting antispam...Done.
            Starting antivirus...Done.
            Starting snmp...Done.
            Starting spell...Done.
    dpkg: attenzione: apertura del file di configurazione "/root/.dpkg.cfg" per la lettura non riuscita: Permesso negato
            Starting mta...Failed.
    dpkg: attenzione: apertura del file di configurazione "/root/.dpkg.cfg" per la lettura non riuscita: Permesso negato
    dpkg: attenzione: apertura del file di configurazione "/root/.dpkg.cfg" per la lettura non riuscita: Permesso negato
    Starting saslauthd...done.
    opendkim: /opt/zimbra/conf/opendkim.conf: ldap://mail.xxxxxxx.com:389/?DKIMSelector?sub?(DKIMIdentity=$d): dkimf_db_open(): Connect error
    Failed to start opendkim: 0
    zmopendkimctl failed to start
    
    
            Starting stats...Done.
    Why don't all zimbra services start? After script end, if I manually start zimbra (zmcontol start) everithing is ok.

    Can anyone help me?

  2. #2
    mickier is offline Loyal Member
    Join Date
    Dec 2007
    Posts
    84
    Rep Power
    7

    Default

    Quote Originally Posted by antoseri View Post
    Why don't all zimbra services start? After script end, if I manually start zimbra (zmcontol start) everithing is ok.

    Can anyone help me?
    Have you fixed it yet? I found on my bckup scripts, I had to add a sleep 150 or some value - to give it time to settle before I restart zimbra...

  3. #3
    slindeneau is offline Junior Member
    Join Date
    Jan 2014
    Posts
    6
    Rep Power
    1

    Default

    Code:
    dpkg: attenzione: apertura del file di configurazione "/root/.dpkg.cfg" per la lettura non riuscita: Permesso negato
    Your configuration file dpkg.cfg is owned by user root while your "zmcontrol startup" is being run by user zimbra.

    To fix this you can either install zimbra as a service and then start it with your root user or grant read access to the zimbra user to the /root/.dpkg.cfg file. There may be another solution but I am not entirely sure why your dpkg.cfg file is even being accessed by your zimbra user.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Backup delete script
    By iway in forum Administrators
    Replies: 8
    Last Post: 10-19-2011, 05:36 PM
  2. Help me with a basic backup script please
    By Abzstrak in forum Administrators
    Replies: 0
    Last Post: 04-28-2010, 06:56 AM
  3. Error in backup Script
    By jay.choklsi in forum Administrators
    Replies: 35
    Last Post: 11-15-2008, 04:39 AM
  4. Little OT, backup script
    By skiv71 in forum Administrators
    Replies: 0
    Last Post: 11-10-2008, 06:02 AM

Tags for this Thread

Posting Permissions

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