Results 1 to 2 of 2

Thread: New help with my zimbra script.

  1. #1
    brucealeg is offline Active Member
    Join Date
    Mar 2007
    Posts
    46
    Rep Power
    8

    Default New help with my zimbra script.

    I use the following script to prune the inboxs on one of my Zimbra 5 servers. The current script does not prune sub folders and I am not sure of the proper syntax to add them into the script - regardless of the sub folders name.

    I'd really appreciate it if any of the script heads could take a look and assist with the proper syntax.

    Script Start:

    #!/bin/bash
    #
    #

    zmprov gaa > /tmp/acccountsList.txt

    for acct in `cat /tmp/acccountsList.txt` ; do

    THEACCOUNT=$acct
    THEDATE=$(date --date='2 days ago' +%m/%d/%y)
    THEFOLDER="/Inbox"

    # (before:$THEDATE)
    touch /tmp/deleteOldMessagesList.txt
    for i in `zmmailbox -z -m $THEACCOUNT search -l 1000 "in:$THEFOLDER (before:$THEDATE)" | grep conv | sed -e "s/^\s\s*//" | sed -e "s/\s\s*/ /g" | cut -d" " -f2`
    do
    if [[ $i =~ [-]{1} ]]
    then
    MESSAGEID=${i#-}
    echo "deleteMessage $MESSAGEID" >> /tmp/deleteOldMessagesList.txt
    else
    echo "deleteConversation $i" >> /tmp/deleteOldMessagesList.txt
    fi
    done

    zmmailbox -z -m $THEACCOUNT < /tmp/deleteOldMessagesList.txt >> /opt/process.log
    rm -f /tmp/deleteOldMessagesList.txt

    done
    rm -f /tmp/acccountsList.txt

    End Script

  2. #2
    federico.bertola's Avatar
    federico.bertola is online now Special Member
    Join Date
    Jul 2006
    Location
    Verona, Italy
    Posts
    153
    Rep Power
    8

    Default

    Have you checked the command emptyFolder?

    My 2 cents.


    Sent from my iPhone using Tapatalk
    Federico Bertola
    CTO @ StudioStorti

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 22
    Last Post: 12-02-2007, 05:05 PM
  2. Can't start Zimbra!
    By zibra in forum Administrators
    Replies: 5
    Last Post: 03-22-2007, 11:34 AM
  3. Replies: 8
    Last Post: 02-27-2007, 04:10 AM
  4. dspam logrotate errors
    By michaeln in forum Users
    Replies: 7
    Last Post: 02-19-2007, 12:45 PM
  5. Fedora Core 3, Clean Install - Not working!
    By pcjackson in forum Installation
    Replies: 17
    Last Post: 03-05-2006, 07:38 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
  •