Postby kanderson » Tue Nov 15, 2005 5:34 pm
Here's a script I use.
It does NOT archive public folders, but it greatly simplifies restores, as I simply throw up a new mailnode called restore, and then use omcpinu to copy the user in.
I'm a hideous coder, but it does work.
In this example, I'm creating a backup directory called /var/opt/current and then copying everyone in the calgary mailnode into there. This will create an USERNAME.OUT file for each person in the mailnode.
It will also cycle the backups for a series of days so that you always have a weeks worth of backups on hand. Obviously, you'll want to write this to tape.
There are several things to note here.
1) I am turning off remote connections. This means that people cannot connect to the server during the backup procedure.
2) This does not archive anything in a public folder.
3) This fails for people with more than 2 Gigs of email data.
4) If you use multiple mailnodes, this needs to run for each of them.
5) I would recommend also adding a line such as:
tar -zcvf /var/opt/current/ScalixBackup.tar.gz /var/opt/scalix /etc/opt/scalix
this WILL get public folders, and >2Gig email folders., but it's ugly to restore from.
There is a knowledgebase article on archiving and backing up data. It's a worthwhile read. Hopefully this script also offers some value. Obviously adding a few variables at the beginning would simplify setting it up for different locations.
=========================================
omoff -d 0 rci
rm -rf /var/opt/7old
mv /var/opt/6old /var/opt/7old
mv /var/opt/5old /var/opt/6old
mv /var/opt/4old /var/opt/5old
mv /var/opt/3old /var/opt/4old
mv /var/opt/2old /var/opt/3old
mv /var/opt/1old /var/opt/2old
mv /var/opt/current /var/opt/1old
mkdir /var/opt/current
chmod 0700 /var/opt/current
date > /var/opt/current/starttime
chown root:root /var/opt/current
date > /var/opt/current/starttime
chown root:root /var/opt/current
touch /var/opt/current/mailbackupscript
chmod 0700 /var/opt/current/mailbackupscript
/opt/scalix/bin/omshowu -m calgary > /var/opt/current/userlist
sed -e 's/\ \/calgary\/CN=/\"\ -f\ \"\/var\/opt\/current\//g' -e 's/^/\/opt\/scalix\/bin\/omcpoutu\ -n\ \"/g' -e 's/$/\.out\"/g' /var/opt/current/userlist > /var/opt/current/mailbackupscript
/var/opt/current/mailbackupscript > /var/opt/current/logfile.txt
mv /var/opt/scalix/log/audit /var/opt/current/
omon rci
date > /var/opt/current/endtime
============================