dotfiles/.scripts/mail/archive.sh
2016-12-29 13:15:03 -08:00

10 lines
389 B
Bash
Executable file

#!/bin/bash
function moveIt { s=${1##*/}; s=${s%%,*}; mv -f $1 $2/$s
s=$(notmuch search --output=files tag:processed and folder:sent | grep -v archived)
for i in $s; do moveIt $i /home/gigavinyl/.mail/archive/new; done
}
s=$(notmuch search --output=files tag:archive and not folder:totrash | grep -v archived)
for i in $s; do moveIt $i /home/gigavinyl/.mail/gigavinyl/archive/new; done