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 Display Modes
  #1 (permalink)  
Old 11-11-2007, 10:50 PM
SSS SSS is offline
Intermediate Member
 
Posts: 20
Default Backup script issues

I'm trying to get the Simple Shell Script Method from HERE working on my server.

I've kept the script the same except for altering the backup folder directory

The problem is, when I run it as root (testing it out see if it'll be ok with CRON) it all seems to run ok, but after the backup is complete I su to the zimbra account and do a zmcontrol status check and it says that the stats module is stopped.

I can stop/start Zimbra as the zimbra user OK, it's just that doing it from sudo causes stats to not start.

Any ideas?



My other problem was trying to get the perl backup script from HERE working instead, but I seem to not have all the necessary modules installed.

First I ran "yum install perl" just to make sure it was installed. I then ran the script and it complained about some IO/Scalar.pm being missing. Did some googling then yum installed perl-IO-Stringy. The script then complained about Proc/ProcessTable.pm being missing, googled then yum installed perl-Proc-ProcessTable.

Now the script is failing saying it can't find File/Rsync.pm but I can't seem to find a perl package for that, and I'm pretty sure rsync is installed on the system anyway.

Am I missing something? Is there a perl rsync module? Are there more modules I need to install or is there a package that has all that I need in it?

Thanks for any help!
Reply With Quote
  #2 (permalink)  
Old 11-12-2007, 09:48 PM
SSS SSS is offline
Intermediate Member
 
Posts: 20
Default

bump!

Any ideas
Reply With Quote
  #3 (permalink)  
Old 11-12-2007, 11:46 PM
Zimbra Consultant & Moderator
 
Posts: 11,320
Default

Command prompt:

Code:
perl -MCPAN -e shell
answer any installation questions that it asks then at the cpan> prompt::

Code:
install  File::Rsync
The list of required modules is at the beginning of the script you're trying to run.
__________________
Regards


Bill
Reply With Quote
  #4 (permalink)  
Old 11-13-2007, 11:05 PM
SSS SSS is offline
Intermediate Member
 
Posts: 20
Default

Thanks Phoenix, that solved the perl rsync issue, but the script then started complaining about needing explicit package names. This perl stuff is going way over my head

I think I'll try and get the bash script going instead.

If I run this script as the Zimbra user when the status checks runs, everything is ok and 'running'
Code:
echo Stopping Zimbra services...
zmcontrol stop
sleep 15

echo Starting Zimbra services...
zmcontrol start
sleep 15

echo Showing Zimbra services status...
zmcontrol status
echo Done!
But if I run the following script as user root, when the status check runs it says the stats module is stopped:
Code:
echo Stopping Zimbra services...
sudo -u zimbra /opt/zimbra/bin/zmcontrol stop
sleep 15

echo Starting Zimbra services...
sudo -u zimbra /opt/zimbra/bin/zmcontrol start
sleep 15

echo Showing Zimbra services status...
sudo -u zimbra /opt/zimbra/bin/zmcontrol status
echo Done!
I'm a bit stumped as to why stats doesn't start up.
Reply With Quote
  #5 (permalink)  
Old 11-14-2007, 01:04 AM
Zimbra Consultant & Moderator
 
Posts: 11,320
Default

What release of Zimbra are you using and which operating system?
__________________
Regards


Bill
Reply With Quote
  #6 (permalink)  
Old 11-14-2007, 01:13 AM
Zimbra Consultant & Moderator
 
Posts: 11,320
Default

I think that sudo may have some problems, try the following format for the command (using su - ):

Code:
su - zimbra -c "zmcontrol start"
__________________
Regards


Bill
Reply With Quote
  #7 (permalink)  
Old 11-14-2007, 09:32 AM
Moderator
 
Posts: 1,010
Default

Quote:
Originally Posted by phoenix View Post
I think that sudo may have some problems, try the following format for the command (using su - ):

Code:
su - zimbra -c "zmcontrol start"
Please post back if this does the trick. If it does I'll revise the script on the wiki.
Reply With Quote
  #8 (permalink)  
Old 11-14-2007, 10:01 AM
Zimbra Consultant & Moderator
 
Posts: 11,320
Default

Quote:
Originally Posted by dwmtractor View Post
Please post back if this does the trick. If it does I'll revise the script on the wiki.
I've already changed the wiki article and added a note at the end of it.
__________________
Regards


Bill
Reply With Quote
  #9 (permalink)  
Old 11-14-2007, 10:42 AM
Moderator
 
Posts: 1,010
Default

Quote:
Originally Posted by phoenix View Post
I've already changed the wiki article and added a note at the end of it.
Thanks Bill.

Would this be a better default method since it doesn't rely on sudo at all? It hadn't occurred to me when I first played with it, do all Linux installations even include sudo?

Dan
Reply With Quote
  #10 (permalink)  
Old 11-14-2007, 11:09 AM
Zimbra Consultant & Moderator
 
Posts: 11,320
Default

I've no idea if all distributions include sudo but if you feel that the 'su -' method is better then feel free change the script in the wiki.
__________________
Regards


Bill
Reply With Quote
Reply


Thread Tools
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.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0