> On 08 Oct 2014, at 16:23 , Duane Hill <duih...@gmail.com> wrote:
> 
> On Wednesday, October 8, 2014, 3:11:06 PM, LuKreme wrote:
> 
>>> On 08 Oct 2014, at 04:56 , Duane Hill <duih...@gmail.com> wrote:
>>> 
>>> On Tuesday, October 7, 2014, 10:56:54 PM, LuKreme wrote:
>>> 
>>>> On 07 Oct 2014, at 11:45 , Jari Fredrisson <ja...@iki.fi> wrote:
>>>>> I ran sa-update & sa-compile.
>>> 
>>>> Should sa-compile be run after sa-update?
>>> 
>>>> I have a crontab entry:
>>> 
>>>> 16  1  *  *  *  /usr/local/bin/sa-update &&
>>>> /usr/local/etc/rc.d/sa-spamd restart
>>> 
>>>> should I add an sa-compile call?
>>> 
>>> I am on FreeBSD here. This is what I use:
>>> 
>>> Content of sa_update.sh:
>>> 
>>> #!/bin/sh
>>> 
>>> /usr/local/bin/sa-update -D --nogpg
>>> 
>>> if [ $? -eq 0 ] ; then
>>> /usr/local/bin/sa-compile
>>> /usr/local/etc/rc.d/sa-spamd restart
>>> exit 0
>>> else
>>> exit 0
>>> fi
>>> 
>>> This  way, sa-compile is ran and spamd is restarted only when there is
>>> an update. I then use the script in a cron which runs once per day.
>>> 
>>> I  believe  the  way  you have it, spamd will get restarted every time
>>> your cron is ran whether there is an update or not.
> 
>> It will get restarted if the sa-update process finishes cleanly
>> (that’s what && does) which I think is the same as if [ $? -eq 0];
> 
>> So, I’ll add an sa-compile in there, thanks.
> 
> No.  &&  is  a  way  of chaining commands together. Your cron says run
> sa-update  and  then  restart  spamd.  In  other words, when sa-update
> finishes  running,  regardless  if there was an update applied or not,
> restart spamd.

No, that is not what it says.

$ man 1 bash
…
The  control  operators  && and || denote AND lists and OR lists, respectively. 
 An AND list has the form

  command1 && command2

command2 is executed if, and only if, command1 returns an exit status of zero.


-- 
What if there were no hypothetical questions?

Reply via email to