Page 1 of 1

Editing v-backup-user

Posted: Mon Nov 16, 2020 8:13 pm
by ozgurerdogan
I want to exlude mail data (actual mails in webmail) when doing all user backup. Because it take much storage and also client using their mail with pop access so store their mail in their outlook. But want to backup mail account along with password for restore.

Can I edit v-backup-user and comment out:

Code: Select all

 # Backup emails
        cd $HOMEDIR/$user/mail/$domain_idn
        accounts=()
        for account in $(ls); do
            exclusion=$(echo "$MAIL" |tr ',' '\n' |grep "$domain:")
            exclusion=$(echo "$exclusion" |tr ':' '\n' |grep "^$account$")

            # Checking exlusions
            if [ -z "$exclusion" ] && [[ "$MAIL_SYSTEM" =~ exim ]]; then
                accounts+=($account)
            else
                echo "$(date "+%F %T") excluding mail account $account" |\
                    tee -a $BACKUP/$user.log
            fi
        done

        # Compress archive
        if [ ${#accounts[@]} -gt 0 ]; then
            tar -cpf- ${accounts[@]} |gzip -$BACKUP_GZIP - > $tmpdir/mail/$domain/accounts.tar.gz
        fi

Re: Editing v-backup-user

Posted: Mon Nov 16, 2020 10:40 pm
by grayfolk
Yes, you can.