Quote:
Originally Posted by Raiky
Just one comment: If the script is not run with the log redirection anytime then the log file is empty always and then the mail feature fails because the cat $LOG string is missing. Also mailing fails if the $EMAILCC field is empty. (since -c -s)
R. |
I'm having a couple of minor problems getting the script working 100% on a CentOS 5.x server and i'm wondering if this is what I'm seeing? (although I don't fully understand the above statement). I get the following error at the end of a FULL backup when the backup log is mailed.
the following is visible in the shell:
./zmbac.sh: line 901: /opt/zimbra-backup-current/Backuplist-21-April-2008.txt.gz: Permission denied
I *do* get an email from root with the log attached. In the email I get an additional line of information:
/opt/zmbac.sh: line 901: /opt/zimbra-backup-dar/Backuplist-21-April-2008.txt.gz: Permission denied
/usr/sbin/sendmail: No such file or directory
Line 901 in the script (copied verbatim off the osoffice website) is:
(cat $LOG; $UUENCODE "$ARCHIVEDIR"Backuplist-"$BACKUPDATE".txt.gz "$ARCHIVEDIR"Backuplist-"$BACKUPDATE".txt.gz) | mail -c $EMAILCC \
-s "Zimbra Full Backup Log on `hostname --fqdn`" $EMAIL
I've done some limited experimentation. In my filesystem I've linked /usr/bin/sendmail to /opt/zimbra/postfix/sbin/sendmail .. but it makes no difference. I've also removed/reinstalled the mailx package using Yum and I've tried altering ownership of /bin/mail from root:mail to root:root and giving it 755 permissions:
[root@zim opt]# whereis mail
mail: /bin/mail /etc/mail.rc /etc/mail /usr/lib/mail.tildehelp /usr/lib/mail.help /usr/share/man/man1/mail.1.gz
[root@zim zimbra-backup-current]# ls -l /bin/mail
-rwxr-xr-x 1 root root 82996 Jan 7 2007 /bin/mail
but still it chucks the error..
Any ideas? .. the script is otherwise awesome and I'm planning to use it to back up my Zimbra OSE installation to an NFS mounted location so the data is automatically stored off-box without the complication of an SCP transfer.
Christian
ps: I'd also like to make the following script enhancement suggestions:
a) Email confirmation of successful DIFF backup, at the moment this is only done for FULL backups
b) Option to specify the number of weeks to keep FULL backups in the TOO_MEDIA_DIR to prevent filling the backup-target filesystem