diff options
-rwxr-xr-x | mail-archive | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mail-archive b/mail-archive index dd2ac3b..79d652c 100755 --- a/mail-archive +++ b/mail-archive @@ -6,13 +6,13 @@ # Setup. INBOX="INBOX" ZNBOX="ZNBOX" -YEAR="`date +%Y`" -mkdir -p ~/mail/$ZNBOX.$YEAR/ +YEAR="${1:=`date +%Y`}" +mkdir -p ~/mail/$ZNBOX/$YEAR/ # Archive mail. -mv ~/mail/$INBOX.* ~/mail/$ZNBOX.$YEAR/ +mv ~/mail/$INBOX.* ~/mail/$ZNBOX/$YEAR/ # Start with a fresh folder structure. -for folder in `ls -1 ~/mail/$ZNBOX.$YEAR/ | grep $INBOX.`; do +for folder in `ls -1 ~/mail/$ZNBOX/$YEAR/ | grep $INBOX.`; do mkdir -p ~/mail/$folder/{cur,new,tmp} done |