Gentoo Archives: gentoo-user

From: Michael Orlitzky <mjo@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] how to update spamassassin with sa-update
Date: Sun, 26 Apr 2015 17:41:37
Message-Id: 553D2341.2060706@gentoo.org
In Reply to: Re: [gentoo-user] how to update spamassassin with sa-update by Alex Brandt
1 On 04/26/2015 10:55 AM, Alex Brandt wrote:
2 > On Sunday, April 26, 2015 13:47:46 lee wrote:
3 >> Hi,
4 >>
5 >> installation notes for spamassassin say you need to do the rule updates
6 >> yourself by running 'sa-update'.
7 >>
8 >> Now I'd do that with a crontab entry, and I don't want to add it to
9 >> root's crontab. As what user should I run it, and where do I put the
10 >> crontab entry for it?
11 >
12 > I use a cronjob in /etc/cron.hourly so it runs as part of the system crontab.
13 >
14
15
16 Same here (cron.daily)... you might be able to get away with running it
17 under a non-root account, but it would need write access to (at least)
18 /var/lib/spamassassin.
19
20 The sa-update program is noisy so I wound up with this:
21
22 #!/bin/bash
23
24 # First, silence stdout.
25 exec 1>/dev/null
26
27 # This thing spits out its progress to stderr.
28 sa-update 2>/dev/null
29
30 # Exit code 0 means new updates were installed. Exit code 1 means we
31 # were already up-to-date. Anything else is failure.
32 if [ $? -eq 0 ]; then
33 sa-compile
34
35 # Are you using amavis?
36 # /etc/init.d/amavisd reload
37 fi