0

I have a small script that seems to be running,according to the logs, but it is not removing the the emails in the folder, as instructed, after processing.

I've searched and searched, but don't know how to troubleshoot any further. Can anyone help:

Here is the script:

#!/bin/bash
/usr/bin/sa-learn --no-sync --spam ~/mail/domainname.com/username/.learn-spam/cur
/usr/bin/sa-learn --no-sync --ham ~/mail/domainname.com/username/.learn-ham/cur
/usr/bin/sa-learn --sync
rm -f ~/mail/domainname.com/username/.learn-spam/cur
rm -f ~/mail/domainname.com/username/.learn-ham/cur

Here is the cron instructions:

/home/accountname/sa-learn.sh >/dev/null 2>&1

I've substituted actual names.

Can anyone shed any light as to why it might not be deleting from those folders?

Thank you!

  • Does it remove spam if you run those commands individually? Is `cur` a directory? If so, you will need `rm -rf`? – vikramls Dec 02 '14 at 22:59
  • I've tested a few different things. I did have a typo as the folder is called learn_spam not learn-spam. But the files are still not deleting. – user1388610 Dec 12 '14 at 19:14
  • Yes, cur is a directory, so I changed to rm -rf, but still no luck. There was an invisible character after bin/bash but still no luck after fixing that either. – user1388610 Dec 14 '14 at 21:19

0 Answers0