LuKreme wrote: > The front actin simply calls sa-update. Do I just > > 16 1 * * * PATH=/usr/bin:/bin:/usr/local/bin /usr/local/bin/sa-update && > /usr/local/bin/sa-compile && /usr/local/etc/rc.d/sa-spamd restart > > ? > > Or is there a reason not to do that?
The syntax "variable=value command" is a /bin/sh syntax which sets the variable for just that command. In the above sa-update would get the PATH setting. But then && terminates that command. The next two commands sa-compile and sa-spamd would not get PATH set differently for them. Is that important to you? Otherwise you would need to repeat the PATH setting for the second and third commands on the command line too. But there is a better way. If you are using vixie-cron (most GNU/Linux distributions do) then you can set PATH globally in the crontab. Simply set it in the crontab file. This doesn't work in traditional legacy crons but does work with vixie-cron. # The default vixie-cron PATH is "/usr/bin:/bin", overriding the environment. PATH="/usr/local/bin:/usr/bin:/bin:/usr/games" Then PATH will be set for all commands started from that crontab. Personally I prefer to use a file /etc/cron.daily/spamassassin which then calls all of the individual programs. The /etc/cron.daily is a directory of scripts (not crontabs) where each script is run once daily one after the other. Since that is a script you can set PATH in that script and again it would be set for all subsequent invocations. Bob