summaryrefslogtreecommitdiffstats
path: root/mailboxes
diff options
context:
space:
mode:
authorRaghavendra D Prabhu <raghu.prabhu13@gmail.com>2011-03-13 00:24:47 +0530
committerRaghavendra D Prabhu <raghu.prabhu13@gmail.com>2011-03-13 00:24:47 +0530
commit5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a (patch)
treedeabb15393558ab3a1a629fc0782d8b0c3124c48 /mailboxes
downloadScripts-5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a.tar.gz
Scripts-5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a.tar.bz2
Scripts-5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a.zip
Initial scripts update
Diffstat (limited to 'mailboxes')
-rwxr-xr-xmailboxes43
1 files changed, 43 insertions, 0 deletions
diff --git a/mailboxes b/mailboxes
new file mode 100755
index 0000000..51f8d72
--- /dev/null
+++ b/mailboxes
@@ -0,0 +1,43 @@
+#!/bin/zsh
+#set -x
+which pushd &>/dev/null || exit 1
+
+pushd -q ~/Mail/Kronos/
+[[ $PWD == */Mail/Kronos ]] && find . -type d -mtime +30 -exec rm -rf {} &>/dev/null \;
+popd -q
+
+#today=$(date +%d-%m-%Y)
+#yesterday=$(date --date='1 day ago' +%d-%m-%Y)
+
+today=$(date +%Y-%m-%d)
+yesterday=$(date --date='1 day ago' +%Y-%m-%d)
+
+if [[ ! ${$(readlink ~/Mail/Kronos/Today):t} == $today \
+ || ! ${$(readlink ~/Mail/Kronos/Yesterday/):t} == $yesterday ]];then
+ rm ~/Mail/Kronos/Yesterday &>/dev/null
+ ln -sf ~/Mail/Kronos/$yesterday ~/Mail/Kronos/Yesterday
+ rm ~/Mail/Kronos/Today &>/dev/null
+ ln -sf ~/Mail/Kronos/$today ~/Mail/Kronos/Today
+fi
+
+
+echo "~/Mail/Kronos/Today \
+ ~/Mail/Kronos/Yesterday \
+ ~/Mail/INBOX/ \
+ ~/Mail/Me/ \
+ ~/Mail/Dyne/ \
+ ~/Mail/Wnohang/ \
+ ~/Mail/Search/ \
+ ~/Mail/Kronos/ \
+ ~/Mail/Yahoo/ \
+ ~/Mail/Sent/ \
+ $(find ~/Mail/ -type d -name new -printf '%d:%C@:%h \n' \
+ | sort -t : -k 1,2 -r \
+ | cut -d : -f 3 \
+ | /bin/grep -v -E '(Chro|Old|Junk|Kro|INBOX|Search|Dyne|Wnohang|Yahoo|Sent|Me|Archive)' \
+ | tr '\n' ' ' \
+ | tr -s ' ') \
+ ~/Mail/Archive/eBackup/"
+
+
+#set +x