Hi
Im using a backup script stolen from this site i think and it works to backup the folders:
#! /bin/bash
# Edit the following two values if necessary
MBOXDIR="/root/backups/mailboxes"
SXDIR="/opt/scalix/bin"
# No more editing after this line
echo "Mailbox Backup Starting [`date`]"
if [ -d $MBOXDIR ]; then
echo "Found Backup Directory ${MBOXDIR}. Using It."
else
echo "Creating Backup Directory ${MBOXDIR} to backup mailboxes."
mkdir -p ${MBOXDIR}
fi
for i in $(${SXDIR}/omshowu -m all | cut -d "/" -f 1 | sed -e 's: $::g' -e 's/ /\//g'); do
user=`printf "$i" | sed -e 's:/: :g'`
#
# $user = Username With Space
# $i = Username With \ Before Space
# ex: $user="Firstname Lastname"
# ex: $i="Firstname\ Lastname"
#
echo
echo +++++++++++++++++++++++++++++++++++++++++++++
echo ${user}
if [ -a $MBOXDIR/$i.mbox ]; then
echo "Existing backup found. Deleting before creating new backup."
rm -f ${MBOXDIR}/${user}.mbox
fi
echo "Backing up user ${user}"
nice -n 19 ${SXDIR}/sxmboxexp -u "${user}" -a ${MBOXDIR}/"${user}".mbox --listlevel folder -F
echo +++++++++++++++++++++++++++++++++++++++++++++
done
echo
echo "Finished backing up user data."
echo
echo
echo "Backing up public folders..."
if [ -a $MBOXDIR/public_folders.mbox ]; then
echo "Existing backup found. Deleting before creating new backup."
rm -f ${MBOXDIR}/public_folders.mbox
fi
nice -n 19 ${SXDIR}/sxmboxexp -p -a ${MBOXDIR}/public_folders.mbox --listlevel folder -F
echo "Done with mailbox backup! [`date`]"
echo
I check that i can see the backup files are in place.
I use omshowu John Doe and its there.
Now i want to test the backup so i removed an account with omdelu John Doe and voila its gone. So i use:
sxmboximp -a "/backup/mailboxes/John Doe.mbox"
to get it back but i get:
sxmboximp : [OM.PM 3024] Cannot find user John Doe /mail/CN=Doe, John
Any ideas?
Regards
/Henrik