Bold indicates a button clicked or key pressed.
“quotes” indicates a value which has been entered.
Grey block quote is a command typed directly into the console.
Manual Backup of Zimbra
1.Gain root shell access to the Zimbra box
#su
#’Your Password’
Stop Zimbra Services from running in order to perform a cold backup. This is necessary so the database and ZCS stay synced. Depending on your installation size, your server may be down for up to 10 minutes. Generally, for a decent sized install with approximately 150 users, the server will only be down for 4-6 minutes.
#sudo -u zimbra /opt/zimbra/bin/zmcontrol stop
3.Make a backup directory and Sync Zimbra Directory to backup directoy
#cd /
#mkdir backup
#cd backup
#mkdir zimbra
#rsync -avHK /opt/zimbra/ /backup/zimbra
4.Restart Zimbra services
#sudo -u zimbra /opt/zimbra/bin/zmcontrol start
5.Create archived backup for offsite transfer via FTP
#tar -zcvf /tmp/mail.backup.gz -C /backup/zimbra .
6.Finally, send the archive backup to an FTP backup server. The username and password should be entered without any quotes. In addition, replace IPADDRESS with your ftp server.
#ncftpput -u ’username -p ’password’ IPADDRESS /mail /tmp/mail.backup.gz
cavp | 09-Feb-10 at 7:20 pm | Permalink
Hi, tried this script in Zimbra 6.0.5 GA RHEL64; there’s an error starting the logger service:
Starting logswatch…/opt/zimbra/bin/zmlogswatchctl: line 72: zmhostname: command not found
/opt/zimbra/bin/zmlogswatchctl: line 72: zmprov: command not found
zimbra logger service is not enabled! failed.
The only way I found is to start manually the logger.
rtrinkle | 10-Feb-10 at 8:36 am | Permalink
cavp-
This is made to manually enter each command, assuming you would like to use the directories I listed above. While using this as a script, you may have output overflow errors in which you have to parse correctly. If you are simply placing these commands in a script and running the script every morning, you will have issues.
Needless to say, I have a backup script that will work for your purpose and can make another post if that is something you will be interested in.
About the error relating to the logger service not being enabled is confusing. All zimbra services should be halted prior to the backup. Verify you are issuing a
“sudo -u zimbra /opt/zimbra/bin/zmcontrol stop” in your script.
cavp | 11-Feb-10 at 7:12 pm | Permalink
Yep, all services are stopped… The error I mentioned occurs in both situations: as a script (that WOULD work if it weren’t for that error) and entering the commands manually; the error happens after the command:
#sudo -u zimbra /opt/zimbra/bin/zmcontrol start
What I have realized is that in the line:
/opt/zimbra/bin/zmlogswatchctl: line 72: zmprov: command not found
It calls the zmprov command, and takes as the user executing it the one that has initiated the session, not the zimbra user (as invoked by “sudo – zimbra”). This only happens in version 6; now, if you have that script for this version, please post it.
Thanks in advance.
TommyBlue | 11-Mar-10 at 8:33 am | Permalink
I’ve the same problem. Probably with sudo some path isn’t included. Try with:
su – zimbra -c “command”
rtrinkle | 11-Mar-10 at 8:49 am | Permalink
Try replace the line in question with:
# su – zimbra
# zmcontrol start
Currently, the script (not this tutorial) works perfectly in a Zimbra 6.0 environment. I will post that later on as it contains a few extra steps to get the script running smoothly.