Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-06-2010, 11:50 PM
Advanced Member
 
Posts: 220
Default Unexpected EOF in archive / backup procedure

Hello,

I'm trying to make a backup script, it is very simple, below is a simple of it:

Code:
local_log_file_name = zimbrabackup.log
su - zimbra -c "zmcontrol -v" >> $local_log_file_name
su - zimbra -c "zmcontrol stop" >> $local_log_file_name
pkill -9 -u zimbra >> $local_log_file_name
rsync -avr /opt/zimbra/ /backup/zimbra
su - zimbra -c "zmcontrol start" >> $local_log_file_name
tar -zcvf /backup/zimbrabackup.tar.gz -C /backup zimbra
when I extract the output compressed file it gives the following error:
Code:
zimbra/data/clamav/db/clamav-18b24c80e244a45ac774591d32a6ddae/main.mdb
zimbra/data/clamav/db/clamav-18b24c80e244a45ac774591d32a6ddae/main.db
zimbra/data/clamav/db/clamav-b567c9ede98c2fc318235f0bc297724c
zimbra/data/clamav/db/clamav-8e8a24ad01a3e38e29fad0508ce5931d/
zimbra/data/clamav/db/clamav-8e8a24ad01a3e38e29fad0508ce5931d/main.fp
zimbra/data/clamav/db/clamav-8e8a24ad01a3e38e29fad0508ce5931d/main.hdb
zimbra/data/clamav/db/clamav-8e8a24ad01a3e38e29fad0508ce5931d/COPYING
zimbra/data/clamav/db/clamav-8e8a24ad01a3e38e29fad0508ce5931d/main.zmd
zimbra/data/clamav/db/clamav-8e8a24ad01a3e38e29fad0508ce5931d/main.info
zimbra/data/clamav/db/clamav-8e8a24ad01a3e38e29fad0508ce5931d/main.ndb
zimbra/data/clamav/db/clamav-8e8a24ad01a3e38e29fad0508ce5931d/main.mdb
zimbra/data/clamav/db/clamav-8e8a24ad01a3e38e29fad0508ce5931d/main.db
zimbra/data/clamav/db/main.cld
zimbra/data/tmp/
zimbra/data/tmp/.swatch_script.21337
zimbra/data/tmp/nginx/
zimbra/data/tmp/nginx/client/
zimbra/data/tmp/nginx/proxy/
zimbra/data/tmp/nginx/fastcgi/
zimbra/data/tmp/.swatch_script.27661
zimbra/data/tmp/.swatch_script.24658
zimbra/data/tmp/.swatch_script.20582
zimbra/data/tmp/.swatch_script.7685
zimbra/data/tmp/.swatch_script.10413
zimbra/data/tmp/.swatch_script.27373
zimbra/data/tmp/.swatch_script.30929
zimbra/data/tmp/syslog.conf.E19379
zimbra/data/tmp/.swatch_script.17217
zimbra/data/tmp/.swatch_script.7666
zimbra/data/tmp/455ee5d0-777f-4962-a86f-012c6729d57c-deferred/
zimbra/data/tmp/455ee5d0-777f-4962-a86f-012c6729d57c-deferred/segments.gen
zimbra/data/tmp/455ee5d0-777f-4962-a86f-012c6729d57c-deferred/segments_6
zimbra/data/tmp/.swatch_script.21368
zimbra/data/tmp/.swatch_script.2173
zimbra/data/tmp/.swatch_script.21253
zimbra/data/tmp/.swatch_script.24135
zimbra/data/tmp/.swatch_script.811
zimbra/data/tmp/.swatch_script.6750
zimbra/data/tmp/.swatch_script.25625
zimbra/data/tmp/.swatch_script.10877
zimbra/data/tmp/.swatch_script.8060
zimbra/data/tmp/syslog.conf.w19392
zimbra/data/tmp/.swatch_script.21139
zimbra/data/tmp/.swatch_script.30226
zimbra/data/tmp/.swatch_script.12964
zimbra/data/tmp/.swatch_script.12900
zimbra/data/tmp/uncompressed/
zimbra/data/tmp/.swatch_script.22879
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
it always stoped on the zimbra/data/tmp path, so any idea about this matter?

Cheers,
__________________
- In a world without walls and fences who needs windows and gates?
- I am Running Linux.. Finally, my PC is valid & Reliable Hereafter.
Reply With Quote
  #2 (permalink)  
Old 04-07-2010, 02:04 AM
Moderator
 
Posts: 7,928
Default

Redirect the output of the tar command as it may be killing the pipe which is created
Code:
tar -zcvf /backup/zimbrabackup.tar.gz -C /backup zimbra >> $local_log_file_name 2>&1
__________________
Reply With Quote
  #3 (permalink)  
Old 04-07-2010, 02:54 AM
Advanced Member
 
Posts: 220
Default

while I'm testing your suggestion, is it possible to exclude the /opt/zimbra/tmp folder?, to be the command like this:
Code:
rsync -aHk --progress --delete --exclude=*.pid --exclude=/opt/zimbra/tmp/* /opt/zimbra/ /backup/zimbra/
is it required here to add trailing / after -C to be like this /backup/ zimbra/
Code:
tar -zcvf /backup/zimbrabackup.tar.gz -C /backup zimbra >> $local_log_file_name 2>&1
__________________
- In a world without walls and fences who needs windows and gates?
- I am Running Linux.. Finally, my PC is valid & Reliable Hereafter.
Reply With Quote
  #4 (permalink)  
Old 04-07-2010, 03:32 AM
Moderator
 
Posts: 7,928
Default

Yes you can just use
Code:
--exclude=/opt/zimbra/tmp/
and for tar you need to use
Code:
tar -zcvf /backup/zimbrabackup.tar.gz -C /backup/zimbra . >> $local_log_file_name 2>&1
__________________
Reply With Quote
  #5 (permalink)  
Old 04-07-2010, 11:53 PM
Advanced Member
 
Posts: 220
Default

I think it work properly, but can I write the command like this:
Code:
tar -zcvf /backup/zimbrabackup.tar.gz -C /backup/zimbra . 2>&1
instead of this
Code:
tar -zcvf /backup/zimbrabackup.tar.gz -C /backup/zimbra . >> $local_log_file_name 2>&1
I noticed that the tar file is now 4.6GB when I used:
Code:
rsync -aHk --progress --delete --exclude=/opt/zimbra/tmp/ /opt/zimbra/ /backup/tmp/zimbra/
unlike when I was using this:
rsync -avr /opt/zimbra/ /backup/tmp/zimbra

it was 5.7GB so is the tmp folder is one GB?
__________________
- In a world without walls and fences who needs windows and gates?
- I am Running Linux.. Finally, my PC is valid & Reliable Hereafter.
Reply With Quote
  #6 (permalink)  
Old 04-08-2010, 03:49 AM
Moderator
 
Posts: 7,928
Default

Its possible though you could check with
Code:
du -sk /opt/zimbra/tmp
With respect to the tar command where do you want to send stdout and stderr ?
__________________
Reply With Quote
  #7 (permalink)  
Old 04-08-2010, 03:56 AM
Advanced Member
 
Posts: 220
Default

no tmp exists:
Quote:
root@zimbra:~# du -sk /opt/zimbra/tmp
du: cannot access `/opt/zimbra/tmp': No such file or directory
__________________
- In a world without walls and fences who needs windows and gates?
- I am Running Linux.. Finally, my PC is valid & Reliable Hereafter.
Reply With Quote
  #8 (permalink)  
Old 04-08-2010, 03:59 AM
Moderator
 
Posts: 7,928
Default

The path should be /opt/zimbra/data/tmp; so you will need to update your exclude within the rsync.
__________________
Reply With Quote
  #9 (permalink)  
Old 04-10-2010, 09:54 PM
Advanced Member
 
Posts: 220
Default

I ran the command and below is the result:
Code:
root@zimbra:~# du -sh /opt/zimbra/data/tmp/
236K    /opt/zimbra/data/tmp/
it seems like are 1/4 M, still don't know why the 1.1GB differents between rsync -aHK
and rsync -avr

Cheers,
__________________
- In a world without walls and fences who needs windows and gates?
- I am Running Linux.. Finally, my PC is valid & Reliable Hereafter.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.