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 01-22-2009, 01:16 PM
Loyal Member
 
Posts: 81
Default Delete Old Backups in Zimbra 5.0.11

How does one delete old full backups? Our policy is to not keep full backups older than two weeks when it comes to email. Therefore, full backups made 2 weeks ago should rotate to /dev/null.

Can I make this automatic?

Thanks!
Reply With Quote
  #2 (permalink)  
Old 04-02-2009, 03:11 AM
Loyal Member
 
Posts: 78
Default

I'm searching for an answer to this in the forum. The best I've found so far is a command:
-----------------------------------------------------------------------------------------
find /opt/zimbra/backup/ -type f -mtime +6 -exec rm -rf {} \;
-----------------------------------------------------------------------------------------

The problem with this command is that it modifies the folder date to current date/time and folders/files are still there with a current date stamp.

I was planing to:
nano /root/remove-old-backups.sh
paste:
-----------------------------------------------------------------------
#!/bin/bash

find /opt/zimbra/backup/ -type f -mtime +14 -print -exec rm -rf {} \;
-----------------------------------------------------------------------
chmod 655 /root/remove-old-backups.sh
nano /etc/crontab
Add this:
-----------------------------------------------------------------------
@daily /root/remove-old-backups.sh
-----------------------------------------------------------------------

Maybe some one can tell me what is wrong, so it can help you to!
Reply With Quote
  #3 (permalink)  
Old 04-02-2009, 03:21 AM
Moderator
 
Posts: 7,928
Default

The -f flag denotes search for regular files. Therefore, when it finds a file with a modifcation date of +14 days then it will remove that file only as no directories are underneath it. You would be better using -d for directories instead. Now you have run it through, as you have seen, the timestamps have been changed so you will have to manually remove them now. The next time it runs, after making that change, all should be okay. Obviously make sure you have a backup to some other sort of media aswell
__________________
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.