sa-update through cron error - SpamAssassin

This is a discussion on sa-update through cron error - SpamAssassin ; Hi, I have a cronjob running once every night /usr/local/bin/sa-update && /usr/local/etc/rc.d/sa-spamd restart when i run it from a shell, everything is allright, but when i run i through cron (root), then i get an email saying error: gpg required ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: sa-update through cron error

  1. sa-update through cron error

    Hi,

    I have a cronjob running once every night

    /usr/local/bin/sa-update && /usr/local/etc/rc.d/sa-spamd restart

    when i run it from a shell, everything is allright, but when i run i
    through cron (root), then i get an email saying

    error: gpg required but not found!

    What i dont understand is why it works if i run it manually?


    Thank you very much in advance,


    Ebbe, Denmark

    System:
    freebsd
    postfix
    spamassassin


  2. Re: sa-update through cron error

    Ebbe Hjorth wrote:
    > Hi,
    >
    > I have a cronjob running once every night
    >
    > /usr/local/bin/sa-update && /usr/local/etc/rc.d/sa-spamd restart
    >
    > when i run it from a shell, everything is allright, but when i run i
    > through cron (root), then i get an email saying
    >
    > error: gpg required but not found!
    >
    > What i dont understand is why it works if i run it manually?
    >
    >

    When runnig as cron, sa-update is unable to find the gpg programm.
    You need to find out where is you gpg is (which gpg) and put it in the PATH
    I suggest to create a small shell script, which runs per cron.
    Something like that:

    #!/bin/bash

    #supposing "which gpg" delivers /usr/bin/gpg
    export PATH=$PATH:/usr/bin
    /usr/local/bin/sa-update
    /usr/local/etc/rc.d/sa-spamd restart


    I hope this helps

    Regards
    Peter


+ Reply to Thread