aboutsummaryrefslogtreecommitdiff
path: root/mail-archive
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-01-04 11:00:21 -0200
committerSilvio Rhatto <rhatto@riseup.net>2016-01-04 11:00:21 -0200
commitd0792db5a2552aef8090efeb2289bd37ce739935 (patch)
tree11bf8e28b710f7908f93004522c27af30b32b4f5 /mail-archive
parent9b735748d5470235a47b2f7dd4fa18df3231d7b9 (diff)
downloadutils-mail-d0792db5a2552aef8090efeb2289bd37ce739935.tar.gz
utils-mail-d0792db5a2552aef8090efeb2289bd37ce739935.tar.bz2
Support for year arg
Diffstat (limited to 'mail-archive')
-rwxr-xr-xmail-archive8
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