[SOLVED] Yet Another Backup Script for Community Version
[SOLVED] Yet Another Backup Script for Community Version
[QUOTE]SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
30 18 * * 1 /bin/bash /opt/scripts/zmbak_v.0.8.sh -f > /var/log/zim_backup.log 2>&1
35 22 * * 2-7 /bin/bash /opt/scripts/zmbak_v.0.8.sh -d >> /var/log/zim_backup.log 2>&1[/QUOTE]
it in root's crontab? if it in /etc/crontab it may be
[QUOTE]SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
30 18 * * 1 root /bin/bash /opt/scripts/zmbak_v.0.8.sh -f > /var/log/zim_backup.log 2>&1
35 22 * * 2-7 root /bin/bash /opt/scripts/zmbak_v.0.8.sh -d >> /var/log/zim_backup.log 2>&1[/QUOTE]
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
30 18 * * 1 /bin/bash /opt/scripts/zmbak_v.0.8.sh -f > /var/log/zim_backup.log 2>&1
35 22 * * 2-7 /bin/bash /opt/scripts/zmbak_v.0.8.sh -d >> /var/log/zim_backup.log 2>&1[/QUOTE]
it in root's crontab? if it in /etc/crontab it may be
[QUOTE]SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
30 18 * * 1 root /bin/bash /opt/scripts/zmbak_v.0.8.sh -f > /var/log/zim_backup.log 2>&1
35 22 * * 2-7 root /bin/bash /opt/scripts/zmbak_v.0.8.sh -d >> /var/log/zim_backup.log 2>&1[/QUOTE]
-
- Elite member
- Posts: 1105
- Joined: Sat Sep 13, 2014 12:47 am
[SOLVED] Yet Another Backup Script for Community Version
I am still running 7.2.1 of zimbra for the moment but have seen several posts about people having issues with rsync based backups since upgrading to version 8.0.n - all to do with a new sparse 85GB data.mdb file
Perhaps a solution to the problem would be to add/modify the functionality of the script as follows:
1. Prior to running rsync - perform a backup of the LDAP database using the approved technique putting the backup somewhere within the /opt/zimbra folder tree - For Ref https://bugzilla.zimbra.com/show_bug.cgi?id=78781#c4
2. add a specific exclude to the rsync command(s) --exclude=/opt/zimbra/data/ldap/mdb/db/data.mdb (I believe that is the path to the offending file)
I believe this would provide a backup of the ldap and would stop the rsync from hanging for a long period of time while trying to figure out what the contents of the data.mdb are - and would also prevent the backup from failing due to an "apparent" lack of disk space.
Perhaps a solution to the problem would be to add/modify the functionality of the script as follows:
1. Prior to running rsync - perform a backup of the LDAP database using the approved technique putting the backup somewhere within the /opt/zimbra folder tree - For Ref https://bugzilla.zimbra.com/show_bug.cgi?id=78781#c4
2. add a specific exclude to the rsync command(s) --exclude=/opt/zimbra/data/ldap/mdb/db/data.mdb (I believe that is the path to the offending file)
I believe this would provide a backup of the ldap and would stop the rsync from hanging for a long period of time while trying to figure out what the contents of the data.mdb are - and would also prevent the backup from failing due to an "apparent" lack of disk space.
-
- Outstanding Member
- Posts: 391
- Joined: Sat Sep 13, 2014 12:06 am
[SOLVED] Yet Another Backup Script for Community Version
anyone knows how to restore, after modifying the script this way?
I mean, in the past unzipping all the backed up stuff was enought to restore Zimbra from this backup.
How to deal with the missing ldap data after this?
Could it be:
unzip stuf
su - zimbra
ldap start
/opt/zimbra/libexec/zmslapadd
ldap stop
zmcontrol start
I mean, in the past unzipping all the backed up stuff was enought to restore Zimbra from this backup.
How to deal with the missing ldap data after this?
Could it be:
unzip stuf
su - zimbra
ldap start
/opt/zimbra/libexec/zmslapadd
ldap stop
zmcontrol start
[SOLVED] Yet Another Backup Script for Community Version
Hi blason,
Have you solved your crontab problem. I am facing the same issue.
the crontab worked fine for a long time, but when I changed the backup path, I got the Stopping mailbox...Failed error.
Have you solved your crontab problem. I am facing the same issue.
the crontab worked fine for a long time, but when I changed the backup path, I got the Stopping mailbox...Failed error.
[SOLVED] Yet Another Backup Script for Community Version
I'm facing the exact same issue after updated from 8.0.1 to 8.0.2, anyone have a working example of the modified backup script can share please !
[SOLVED] Yet Another Backup Script for Community Version
[quote user="xenonsky"]I'm facing the exact same issue after updated from 8.0.1 to 8.0.2, anyone have a working example of the modified backup script can share please ![/QUOTE]
this works to me: add zimbra to PATH
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/zimbra/bin:/opt/zimbra/postfix/sbin:/opt/zimbra/openldap/bin:/opt/zimbra/snmp/bin:/opt/zimbra/rsync/bin:/opt/zimbra/bdb/bin:/opt/zimbra/openssl/bin:/opt/zimbra/java/bin
this works to me: add zimbra to PATH
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/zimbra/bin:/opt/zimbra/postfix/sbin:/opt/zimbra/openldap/bin:/opt/zimbra/snmp/bin:/opt/zimbra/rsync/bin:/opt/zimbra/bdb/bin:/opt/zimbra/openssl/bin:/opt/zimbra/java/bin
[SOLVED] Yet Another Backup Script for Community Version
[quote user="bma"]this works to me: add zimbra to PATH
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/zimbra/bin:/opt/zimbra/postfix/sbin:/opt/zimbra/openldap/bin:/opt/zimbra/snmp/bin:/opt/zimbra/rsync/bin:/opt/zimbra/bdb/bin:/opt/zimbra/openssl/bin:/opt/zimbra/java/bin[/QUOTE]
Thanks for the tips, I've just added the path to /etc/crontab and rebooted, then manually try to run a full backup and still got the same error:
Doing a hotsync of /opt/zimbra/ to /tmp/fakebackup/
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: write failed on "/tmp/fakebackup/data/ldap/mdb/db/data.mdb": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(301) [receiver=3.0.6]
rsync: connection unexpectedly closed (981 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]
rsync threw a hotsync error. this is not unusual, continuing...
any modification required for the original zmbak_v.0.8.sh script?
Thanks!
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/zimbra/bin:/opt/zimbra/postfix/sbin:/opt/zimbra/openldap/bin:/opt/zimbra/snmp/bin:/opt/zimbra/rsync/bin:/opt/zimbra/bdb/bin:/opt/zimbra/openssl/bin:/opt/zimbra/java/bin[/QUOTE]
Thanks for the tips, I've just added the path to /etc/crontab and rebooted, then manually try to run a full backup and still got the same error:
Doing a hotsync of /opt/zimbra/ to /tmp/fakebackup/
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: write failed on "/tmp/fakebackup/data/ldap/mdb/db/data.mdb": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(301) [receiver=3.0.6]
rsync: connection unexpectedly closed (981 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]
rsync threw a hotsync error. this is not unusual, continuing...
any modification required for the original zmbak_v.0.8.sh script?
Thanks!
[SOLVED] Yet Another Backup Script for Community Version
Well that actaully did not resolve the issue but I done the trick and so far backup is running fine.
I commented out a original zimbra stop line and added
zmmailboxd stop && /etc/init.d/zimbra stop
I commented out a original zimbra stop line and added
zmmailboxd stop && /etc/init.d/zimbra stop
[SOLVED] Yet Another Backup Script for Community Version
Blason,
Do you mean changing the following section from the zmback_v.0.8.sh ?
# Stopping Zimbra
echo "Stopping the Zimbra server..."
echo
su - $ZM_USER -c $ZM_HOME"bin/zmcontrol stop"
if [ "$?" -eq "1" ]
then
echo "zmcontrol shutdown had an error!"
mail_log
exit 1
fi
to the following:
# Stopping Zimbra
echo "Stopping the Zimbra server..."
echo
#su - $ZM_USER -c $ZM_HOME"bin/zmcontrol stop"
zmmailboxd stop && /etc/init.d/zimbra stop
if [ "$?" -eq "1" ]
then
echo "zmcontrol shutdown had an error!"
mail_log
exit 1
fi
Do you mean changing the following section from the zmback_v.0.8.sh ?
# Stopping Zimbra
echo "Stopping the Zimbra server..."
echo
su - $ZM_USER -c $ZM_HOME"bin/zmcontrol stop"
if [ "$?" -eq "1" ]
then
echo "zmcontrol shutdown had an error!"
mail_log
exit 1
fi
to the following:
# Stopping Zimbra
echo "Stopping the Zimbra server..."
echo
#su - $ZM_USER -c $ZM_HOME"bin/zmcontrol stop"
zmmailboxd stop && /etc/init.d/zimbra stop
if [ "$?" -eq "1" ]
then
echo "zmcontrol shutdown had an error!"
mail_log
exit 1
fi
-
- Posts: 10
- Joined: Sat Sep 13, 2014 3:04 am
[SOLVED] Yet Another Backup Script for Community Version
Last time i had to backup and restore my Zimbra 8.0.2. For the ldap database i used the tool mdb_copy which is included in zimbra.
So maybe this is a good way:
1. rsync zimbra to backup directory and exclude ldap db (maybe --exclude=/opt/zimbra/data/ldap/mdb/db/data.mdb)
2. Stop zimbra and copy the ldap database with mdb_copy (usage: mdb_copy srcpath dstpath). This will not copy the whole sparse file, it will copy the real size file.
3. Maybe rsync again
4. Start zimbra
mdb_copy worked great for me.
To restore on a new server:
1. I installed Zimbra (same verison) with ./install.sh -s
2. Moved the new Installation with mv /opt/zimbra /opt/zimbra_new
3. Copied the backup into /opt/zimbra
4. Started Zimbra
5. Ran the installer again with ./install.sh
Works!
So maybe this is a good way:
1. rsync zimbra to backup directory and exclude ldap db (maybe --exclude=/opt/zimbra/data/ldap/mdb/db/data.mdb)
2. Stop zimbra and copy the ldap database with mdb_copy (usage: mdb_copy srcpath dstpath). This will not copy the whole sparse file, it will copy the real size file.
3. Maybe rsync again
4. Start zimbra
mdb_copy worked great for me.
To restore on a new server:
1. I installed Zimbra (same verison) with ./install.sh -s
2. Moved the new Installation with mv /opt/zimbra /opt/zimbra_new
3. Copied the backup into /opt/zimbra
4. Started Zimbra
5. Ran the installer again with ./install.sh
Works!