I am trying to write bash script wich can cleanup my whoole server from spam emails that already are present in my client's folders. I would need this script to do,
Check recursively directory /var/qmail/mailnames/* for array of keywords if files with keyword has been found go two levels up to and move files there.
I have started to write something like this, but it will not work as i need. First thing is that i get Argument list too log.
Code:
grep -lir 'discount' /var/qmail/mailanmes/* | xargs mv -t /var/qmail/