Results 1 to 3 of 3

Thread: Backup of all user accounts

  1. #1
    Kharlos is offline New Member
    Join Date
    Oct 2012
    Posts
    4
    Rep Power
    2

    Default Backup of all user accounts

    How can I make a backup of all users accounts? I have this script .sh to run on my OS but it says permission denied at run it, I'm Running this .sh with root user

    Code:
    #/bin/bash
    ##
    # JSJ 2012
    
    BACKUP_DIR=/opt/backup
    DATE=`date +%d%b%Y`
    # LOG=$BACKUP_DIR/$DATE/$DATE.log
    # touch $BACKUP_DIR/$DATE/$DATE.log
    mkdir $BACKUP_DIR/$DATE
    touch $BACKUP_DIR/$DATE/$DATE.log
    LOG=$BACKUP_DIR/$DATE/$DATE.log
    OLD=$(date +%d%b%Y –date=’15 days ago’)
    # Create list and save usuarios.txt
    /opt/zimbra/bin/zmprov -l gaa >> $BACKUP_DIR/$DATE/usuarios.txt
    for user in `cat $BACKUP_DIR/$DATE/usuarios.txt`; do
    echo ” Creating backup of ” $user “” >> $LOG
    # Exporting emails of user in format usuario.tgz.
    sudo -u zimbra /opt/zimbra/bin/zmmailbox -z -m $user getRestURL “//?fmt=tgz” > $BACKUP_DIR/$DATE/$user.tgz
    done
    if [ -d $BACKUP_DIR/$OLD ] # Si el directorio existe..
    then
    echo “Delete folder 15 days ago.” >> $LOG
    rm -rf /opt/backup/$OLD
    else
    echo “Folder doesn't exist.” >> $LOG
    fi

  2. #2
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,585
    Rep Power
    57

    Default

    Quote Originally Posted by Kharlos View Post
    How can I make a backup of all users accounts?
    Use any one of the backup methods in the Zimbra wiki or the threads in this forum on that topic.

    Quote Originally Posted by Kharlos View Post
    I have this script .sh to run on my OS
    Where did you get this script from?

    Quote Originally Posted by Kharlos View Post
    ... but it says permission denied at run it,...
    Did you not get any instructions from where ever you downloaded this script?

    Quote Originally Posted by Kharlos View Post
    I'm Running this .sh with root user
    Why are you doing that when it contains a Zimbra zmprov command?
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  3. #3
    Kharlos is offline New Member
    Join Date
    Oct 2012
    Posts
    4
    Rep Power
    2

    Default

    Quote Originally Posted by phoenix View Post
    Use any one of the backup methods in the Zimbra wiki or the threads in this forum on that topic.

    Where did you get this script from?

    Did you not get any instructions from where ever you downloaded this script?

    Why are you doing that when it contains a Zimbra zmprov command?
    I get the script from Backup y restauración de buzones en Zimbra Open Source Edition | endebian

    what user I need to use zmprov command?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. want to Backup Only accounts and mail
    By deep_singha in forum Administrators
    Replies: 0
    Last Post: 07-26-2012, 10:41 AM
  2. Replies: 2
    Last Post: 09-22-2011, 01:44 AM
  3. Missing Accounts in Backup!
    By Yopofun in forum Administrators
    Replies: 2
    Last Post: 12-08-2010, 01:22 PM
  4. OSS HOT Backup for individual accounts
    By SGIA in forum Administrators
    Replies: 1
    Last Post: 10-05-2008, 02:17 AM
  5. User Accounts Backup & Restore
    By chanck in forum Administrators
    Replies: 1
    Last Post: 03-12-2006, 10:27 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
  •