= Manutenção do ambiente Expresso Livre = [[BR]] [[PageOutline(2, Links)]] == Como atualizar a aplicação == Para atualizar seu Expresso utilize o pacote encontrado em http://www.expressolivre.org/html/expressolivre/index.php?page=downloads. Este pacote contém o código mais recente e estável do !ExpressoLivre. Depois de descompactado faça uma cópia do arquivo header.inc.php para seu novo diretório. Alguns módulos necessitam de atualizações no banco de dados. Para fazer as atualizações, que são necessárias no SQL, acesse o hostname/setup e refaça o Passo 5 - Gerenciamento avançado da aplicação. '''O roteiro mais detalhado é encontrado''' [wiki:atualizarExpresso nesta página] == Backup == É preciso fazer backup de todos os serviços, separadamente. É possível exportar os SQL com pg_dump, gerar ldif e fazer backup da pasta /var/spool/cyrus para os emails. Isso já garante boa parte do funcionamento do serviço. == Verificador de cota == Script Shell utilizado para verificar quais usuários estão com a cota acima de um determinado limiar. {{{ #!/bin/bash ## # @AUTHOR Rodrigo Souza dos Santos # @DATE 2009/05/21 # @BRIEF This script identifies users to share # e-mail larger than a certain threshold # and send an email to the administrator. ## #/* foreground colors */ #define AFC_BLACK 30 #define AFC_RED 31 #define AFC_GREEN 32 #define AFC_YELLOW 33 #define AFC_BLUE 34 #define AFC_MAGENTA 35 #define AFC_CYAN 36 #define AFC_WHITE 37 #/* ansi background colors */ #define ABC_BLACK 40 #define ABC_RED 41 #define ABC_GREEN 42 #define ABC_YELLOW 43 #define ABC_BLUE 44 #define ABC_MAGENTA 45 #define ABC_CYAN 46 #define ABC_WHITE 47 # Função para imprimir colorido # $1 -> Número da cor do texto # $2 -> Número da cor de fundo # $3 -> Texto # $4 -> Imprimir na mesma linha, use -n DEBUG=1 cecho(){ if [ $DEBUG -gt 0 ] then echo ${4} -e "e[${1};${2}m${3}";tput sgr0; fi } SENDMAIL=/usr/sbin/sendmail FROM="rodsouza@ecelepar10631" EMAILTARGET="rodsouza@ecelepar10631" SUBJECT="Cyrus Alert: Over Quota" # When DISPLAY_ALL is 0, only exceeded the quota # information will appear, if 1 then information # about all users will appear DISPLAY_ALL=0 # default limit LIMIT=90 # ensures that the argument is a number if ( echo ${1} | grep -E '^(*100|[0-9]{1,2})$' > /dev/null ) then LIMIT=${1} fi clear CONTENT="" for i in a b c d e f g h i j k l m n o p q r s t u v w x y z do if [ -d "/var/lib/cyrus/quota/${i}" ] then for FILE in `ls -1 /var/lib/cyrus/quota/${i} | grep -E -v 'user.[^.]+.NEW$'` do USER=`echo ${FILE} | cut -c 6-`; FILE="/var/lib/cyrus/quota/${i}/${FILE}" QUOTA=`tail -n1 ${FILE}` USAGE=`head -n1 ${FILE}` PERCENT=`expr ${USAGE} / ${QUOTA}` USAGE=$((USAGE/1024)) let "PERCENT/=10" echo OUTPUT="${USER} quota: ${QUOTA} MB usage: ${USAGE} MB" OUTPUT="${OUTPUT} percent: ${PERCENT}%" if [ ${PERCENT} -gt ${LIMIT} ] then # command to be executed when the quota is higher than desired. OUTPUT="${OUTPUT} quota is higher than ${LIMIT}%" CONTENT="${CONTENT}The user "${USER}" is using ${PERCENT}%% of its quota. " CONTENT=${CONTENT}"quota: ${QUOTA} usage: ${USAGE} " #MSGDATE=`date +"%a, %e %Y %T %z"` #MSG="Date: ${MSGDATE} From: ${FROM} To: ${EMAILTARGET} Subject: ${SUBJECT}" #MSG=${MSG}" Mime-Version: 1.0 X-Mailer: ExpressoMail ${CONTENT}" # send an email #printf "${MSG}" | ${SENDMAIL} -t cecho 1 41 "${OUTPUT}" -n echo else if [ $DISPLAY_ALL -gt 0 ] then cecho 1 1 "${OUTPUT}" fi fi done fi done if [ ${#CONTENT} -gt 0 ] then MSGDATE=`date +"%a, %e %Y %T %z"` CONTENT="This alert is auto generated when a user exceeds ${LIMIT}%% of its quota. ---- ${CONTENT}" MSG="Date: ${MSGDATE} From: ${FROM} To: ${EMAILTARGET} Subject: ${SUBJECT}" MSG=${MSG}" Mime-Version: 1.0 X-Mailer: ExpressoMail ${CONTENT}" # send an email printf "${MSG}" | ${SENDMAIL} -t fi }}}