Shell & Cron Scripting Help

Hi I'm not very good at shell scripting and need a hand.

I use SpamAssassin's Bayesian filter to personalize my spam catching, but I'd like to automate the running of the sa-learn command.

I'd like to have these commands run every day at 3 AM (cron obviously but I can't get it to work right!) so that my database can be up to date and I don't have to manually run the command to update my database.

sa-learn --no-sync --spam ~/Maildir/.Junk/cur/
sa-learn --no-sync --ham ~/Maildir/.Trash/cur/
sa-learn --sync

If anyone has a good tutorial that I could read about I'd really like this, ideally I'd like to move these commands to one file and then have cron call that so that I can edit it easier, and eventually build a web-app for it, as well as my preferences for spam_assassin.

 

 

 

 

Top