This is what I use on my backup server (separate from my email/zimbra server). I chopped out all the other things that I backup along with zimbra. This assumes that the zimbra server has a user named "backup" that's in the group of "zimbra".
Code:
#!/bin/bash
#/root/unmounts.sh
echo Unmounting...
/bin/umount -v /mnt/zimbra
Code:
#!/bin/bash
#/root/mounts.sh
/bin/sh /root/unmounts.sh
echo Mounting...
/bin/mkdir -pv /mnt/zimbra
/bin/mount -r -t cifs -o username=backup,password=password,ip=x.x.x.x,ro //mail/zimbra /mnt/zimbra
/bin/mount -l
Code:
#!/bin/bash
#/root/backup.sh
/bin/mkdir -pv /backup/zimbra
/usr/bin/rsync -av --partial --delete /mnt/zimbra/ /backup/zimbra/
The "a" parameter if for archive mode so that it recurses the subdirectories, among other things. The "v" parameter turns on verbosity so I can see what it's doing when I run the script manually. The "partial" parameter keeps partially transfered files. The "delete" parameter deletes files that are no longer available on the source. My backup server is really a nightly synchronization server. I leave archival backups to a tape drive.