#!/bin/bash
domain="@my.domain"
backupdir="/root/backup/users"
echo "Start to backup => `date`"
if [ ! -d $backupdir ]; then
echo "$backupdir not existing, create it now automatically"
mkdir -p $backupdir
fi
index=1
sudo -u zimbra /opt/zimbra/bin/zmprov gaa |
while read line; do
echo -n "[$index]backup user : $line..."
username=`echo $line | cut -d@ -f1`
sudo -u zimbra /opt/zimbra/bin/zmmailbox -z -m $line getRestURL "//?fmt=tgz" > $backupdir/$username.tgz
if [ $? -eq 0 ]; then
echo "OK [`du -h $backupdir/$username.tgz | awk '{print $1}'`]"
else
echo "Fail"
fi
index=`expr $index + 1`
done
echo "Backup finish => `date`"
Windows and linux information and one stop centre for myself. Having difficulties to remember all things at once. This blog will remain be my references on the internet. Other people can take benefit from it. Thank you for visiting
Subscribe to:
Post Comments (Atom)
Simple Python Calculator This script will allows your to calculate the integers given with the chosen operation. You can add, substract, mu...
-
Make your own OpenAi chat I am totally new comer in Python trying to learn this language from scratch. Knowing a basic of python language i...
-
Always getting some gpg error while trying to do aptitude update on older version of debian platform such as etch or lenny. The message look...
-
i found this registry tweak for dns cache in windows xp but don't really know it works or not... give a try edit your registry or put in...
No comments:
Post a Comment