Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Backup script issues

  1. #11
    dwmtractor's Avatar
    dwmtractor is offline Moderator
    Join Date
    Jul 2007
    Location
    San Jose, CA
    Posts
    1,027
    Rep Power
    9

    Default

    OK, I tried this method from the command line on my Ubuntu 6.06 LTS install, and when I used the
    su - zimbra -c "zmcontrol start"
    method, although zmcontrol status showed all the modules running, the web UI shows red "X" by Spell, SNMP, MTA, and Antivirus as well as Status. Just going from root to su - zimbra and then running zmcontrol stop & start, and the only red X is by Status. I don't know why, or even where to look to find out why, but if I had to guess I wonder whether running the whole command from root results in some odd file permissions issues.

    I'll be interested to hear how it works (or not) for SSS. . .by the way, you didn't say what version you were on. I presume "yum" means SuSe, but what release of Zimbra?

    Whatever is going on, although I've had that red X by Status for a couple of weeks (despite stopping & restarting using the shell script backup every night), I am unable to tell that it hurts anything. The graphs and the nightly summary emails are clearly generated by other processes.

    Dan

  2. #12
    SSS
    SSS is offline Intermediate Member
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    21
    Rep Power
    7

    Default

    Quote Originally Posted by phoenix View Post
    What release of Zimbra are you using and which operating system?
    Yes, I should've posted that in the OP, hehe. It's Zimbra 4.5.9 GA, and the OS is Fedora 7.

    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"
    I altered the script to use the su command you suggested above and it appears to start correctly now. Although check a further comment below about it.

    Quote Originally Posted by dwmtractor View Post
    although zmcontrol status showed all the modules running, the web UI shows red "X" by Spell, SNMP, MTA, and Antivirus as well as Status. Just going from root to su - zimbra and then running zmcontrol stop & start, and the only red X is by Status. I don't know why, or even where to look to find out why, but if I had to guess I wonder whether running the whole command from root results in some odd file permissions issues.
    ?
    I actually got that issue a few times running the new script too. At one stage only the logger and ldap modules were running according to the admin console, but zmcontrol status said they're all up and running which is odd. I restarted the PC and the script seems to be behaving itself at the moment.


    PS On a side note, dwmtractor, for your bash backup script it may be better if you have the rsync lines include the --delete parameter. At the moment it'll backup the zimbra folder into a backup folder then compress that folder into a tarball. The next time the script runs it'll just keep adding and updating new files to the backup folder without deleting old files/folders, which could cause junk to build up over time?

    Including the --delete option in the command gets rid of files in the destination folder that don't exist at the source.
    Last edited by SSS; 11-14-2007 at 06:54 PM.

  3. #13
    dwmtractor's Avatar
    dwmtractor is offline Moderator
    Join Date
    Jul 2007
    Location
    San Jose, CA
    Posts
    1,027
    Rep Power
    9

    Default

    Quote Originally Posted by SSS View Post
    PS On a side note, dwmtractor, for your bash backup script it may be better if you have the rsync lines include the --delete parameter. At the moment it'll backup the zimbra folder into a backup folder then compress that folder into a tarball. The next time the script runs it'll just keep adding and updating new files to the backup folder without deleting old files/folders, which could cause junk to build up over time?

    Including the --delete option in the command gets rid of files in the destination folder that don't exist at the source.
    Excellent suggestion, SSS, I'm going to make that mod to the script right now.

    It looks from this man page like the syntax should be -e --delete. Therefore the whole line will be revised to:
    Code:
    rsync -avHK -e --delete /opt/zimbra/ /backup/zimbra
    Thank you!

    Dan

  4. #14
    mmorse's Avatar
    mmorse is offline Moderator
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    Gonna slowly turn this into a larger script eh?
    I made some slight edits for ya to look at - the reasons can be found in the history notes: Open Source Edition Backup Procedure - History - Zimbra :: Wiki
    (posting here because I don't know if you both have minor edit emails turned on)

    Side track: If you want some fun checkout rotating rsync incermentals & even easier try a rsnapshot setup - it saves a boatload of space

    Use it in a more live mode via a crontab and you should really end up with all the important stuff (though for the first 'full' of the entire set that you make be sure that zimbra's stopped) - or throw it into an existing cold script/crontab.

    To grab 'exactly what's going on with your box' you could run it on redologs...
    zmprov mcf zimbraRedoLogDeleteOnRollover FALSE (then reboot so it applies) should get you decently started.
    You can adjust the size by modifying zimbraRedoLogRolloverFileSizeKB (102400 is the 100MB default).
    Last edited by mmorse; 11-30-2007 at 06:51 PM.

  5. #15
    dwmtractor's Avatar
    dwmtractor is offline Moderator
    Join Date
    Jul 2007
    Location
    San Jose, CA
    Posts
    1,027
    Rep Power
    9

    Default

    Thanks to sss and Mike for the addition of the Zimbra version check on the script. I moved it down to after the second rsync so as to not have it blown away in the rsync, while preserving the ability of --delete to get rid of the temp files that would otherwise be left over from the first live rsync.

    Mike's idea of rsnapshot is an interesting one that could take the shell script from single-backup to a whole incremental stack. I don't have time to play with it now but it's certainly worth exploring!

  6. #16
    SSS
    SSS is offline Intermediate Member
    Join Date
    Oct 2007
    Location
    Australia
    Posts
    21
    Rep Power
    7

    Default

    With the zimbra version thing I put in the wiki bash script, the script is usually run as root thus the rsync commands run as root too. When I was setting up my script I was getting permission denied errors for the creation of the zimbra_version.txt so I chmod 777 the zimbra backup folder and it worked.

    Just make sure that where the txt file is going, the zimbra user has write access. But yeah, more sensible where it is now after the second rsync.

  7. #17
    dwmtractor's Avatar
    dwmtractor is offline Moderator
    Join Date
    Jul 2007
    Location
    San Jose, CA
    Posts
    1,027
    Rep Power
    9

    Default

    Quote Originally Posted by SSS View Post
    With the zimbra version thing I put in the wiki bash script, the script is usually run as root thus the rsync commands run as root too. When I was setting up my script I was getting permission denied errors for the creation of the zimbra_version.txt so I chmod 777 the zimbra backup folder and it worked.
    That makes sense and I would not have thought of it till my own was erroring out. . .that little factoid ought to be added to the wiki. Do you want to go ahead and put it there, probably as a note along with the one on alternate su and the other on logging?

  8. #18
    mmorse's Avatar
    mmorse is offline Moderator
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    Thought I threw in /backup/zimbra/conf/ which should be owned and writable by zimbra.zimbra after the rsync.
    (Thought it would be better than messing with permissions)
    # Create a txt file in the backup directory that'll contain the current Zimbra server version. Handy for knowing what version of Zimbra a backup can be restored to.
    sudo -u zimbra zmcontrol -v > /backup/zimbra/conf/zimbra_version.txt
    # or examine your /opt/zimbra/.install_history
    Last edited by mmorse; 12-03-2007 at 10:02 AM. Reason: quote

  9. #19
    dwmtractor's Avatar
    dwmtractor is offline Moderator
    Join Date
    Jul 2007
    Location
    San Jose, CA
    Posts
    1,027
    Rep Power
    9

    Default

    Quote Originally Posted by mmorse View Post
    Thought I threw in /backup/conf/ which should be owned and writable by zimbra.zimbra after the rsync.
    (Thought it would be better than messing with permissions)
    So you did. That is the version currently on the wiki. Since SSS originally had it before the rsync, the permissions would not yet have been set.

    Thanks for the clarification, Mike! No wiki edit necessary!

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Zimbra Backup Script ... Small Problem
    By frankb in forum Administrators
    Replies: 12
    Last Post: 07-14-2008, 08:40 AM
  2. FYI: ZCS NE backup to fuse/sshfs mount, worked.
    By jagipson in forum Administrators
    Replies: 0
    Last Post: 09-28-2007, 06:37 AM
  3. OSE rotating backup script
    By reckless2k2 in forum Installation
    Replies: 1
    Last Post: 07-04-2007, 04:55 AM
  4. Backup issues
    By telescop in forum Administrators
    Replies: 3
    Last Post: 03-01-2007, 06:09 PM
  5. Backup issues in the Network Edition
    By john99 in forum Administrators
    Replies: 3
    Last Post: 08-17-2006, 09:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •