jeff-j of osxroot
2/24/2015 - 6:23 PM

archive mail archive accounts and drop after 3 months

archive mail archive accounts and drop after 3 months

#!/bin/bash
guid="DE79B95E-FA49-4508-B5F5-B014129F3FC7"
ms_path="/Volumes/DSVDATA/mail.data"


### rotate archive account mail

cd $ms_path/$guid

#### make new week 

now=$(date +"%m_%d_%Y")


#### make temp & new inside

mkdir -p WeekEnding_$now/{new,tmp}

#### mv cur into week dir

mv cur WeekEnding_$now/

#### make new curt

mkdir cur


chown -R  _dovecot:mail *

#### Find command to remove any fodlers older the 3 months

find $ms_path/$guid/ -type d -mtime +90 -delete

#### enjoy a milkbone in a commie free world