Results 1 to 3 of 3

Thread: Delete Old Backups in Zimbra 5.0.11

  1. #1
    Join Date
    Sep 2008
    Location
    Princeton, NJ
    Posts
    81
    Rep Power
    7

    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!

  2. #2
    Join Date
    Nov 2008
    Posts
    78
    Rep Power
    7

    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!

  3. #3
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    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

Similar Threads

  1. Replies: 8
    Last Post: 01-12-2012, 02:20 AM
  2. admin consol blank after 5.0.3 upgarde
    By maumar in forum Administrators
    Replies: 6
    Last Post: 03-21-2008, 06:16 AM
  3. Replies: 12
    Last Post: 02-25-2008, 07:28 PM
  4. [SOLVED] Clamav problem ? What's happening ?
    By aNt1X in forum Installation
    Replies: 23
    Last Post: 02-14-2008, 05:43 AM
  5. 3.1 on FC4 problems
    By cohnhead in forum Installation
    Replies: 8
    Last Post: 05-26-2006, 12: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
  •